Publications by jenny hsu

0921HW1

28.09.2020

0.1 set some options options(digits=3, show.signif.stars=FALSE) digits=3設定數值呈現到小數第三位 show.signif.stars=FALSE 顯著值不用打星星 0.2 packagage management # load packages pacman::p_load(alr4, tidyverse) load alr4 tidyverse packages 0.3 load data data(UN11, package="alr4") load UN11 data from package=alr4 0.4 random...

664 sym R (3263 sym/19 pcs) 1 img

hw2:Regression with dependent errors

27.09.2020

0.1 trial by trial reaction time data # load packages pacman::p_load(languageR, lattice, tidyverse, nlme, lmtest) # load data data(heid, package="languageR") # see first 6 lines of data head(heid) ## Subject Word RT BaseFrequency ## 1 pp1 basaalheid 6.69 3.56 ## 2 pp1 markantheid 6.81 5.16 ## 3 p...

626 sym R (5519 sym/26 pcs) 4 img

in class ex2:Loudness data example

23.09.2020

0.1 regression with clusters options(show.signif.stars = FALSE, digits = 5) 0.2 install.packages(“pacman”) pacman::p_load(alr4, tidyverse, magrittr) 0.3 data management data(Stevens, package="alr4") dta <- Stevens %>% rename(Length=y, Loudness=loudness, Subject=subject) ot <- theme_set(theme_bw()) 0.4 regression plot ggplot(dta, aes...

294 sym R (8216 sym/17 pcs) 3 img

in-class1:Framingham example

22.09.2020

0.1 Open data #file location fL<-"https://math.montana.edu/shancock/data/Framingham.txt" dta <- read.table(fL, header=T) 0.2 recode gender variable # dta$sex <- factor(dta$sex, levels=c(1, 2), labels=c("M", "F")) 0.3 lattice plot library(lattice) xyplot(sbp ~ dbp | sex, data=dta, cex=.5, ...

256 sym R (1852 sym/8 pcs) 2 img

hw2

20.09.2020

# input data dta <- read.table("http://www.amstat.org/publications/jse/datasets/sat.dat.txt") #assign variable names names(dta) <- c("State", "Expend", "Ratio", "Salary", "Frac", "Verbal", "Math", "Sat") # check data structure str(dta) ## 'data.frame': 50 obs. of 8 variables: ## $ State : chr "Alabama" "Alaska" "Ari...

6 sym R (2480 sym/10 pcs) 1 img

in-class ex 3

18.09.2020

0.1 Introduction Kreft and de Leeuw (1998) obtained a sub-sample of students in eighth grade from the National Education Longitudinal Study of 1988 (NELS–88) collected by the National Center for Educational Statistics of the U.S. Department of Education. The students are nested in schools. Here, we consider the following subset of the variables...

780 sym R (3423 sym/15 pcs) 4 img

in-class ex 7

18.09.2020

0.1 Introduction Ten subjects were played tones at each of 5 loudnesses, in random order. Subjects were asked to draw a line on paper whose length matched the loudness of the tone. Each subject repeated each loudness 3 times, for a total of 30 trials per subject. Here is the mean of the 3 log-lengths for each loudness, the sd of the three log-len...

994 sym R (740 sym/5 pcs) 1 img

in-class ex 5

18.09.2020

0.1 Data management In this section, we load the exam scores data set, activate the help page for it, and examine the first 6 lines of the data frame object. # load the package to working directory library(mlmRev) # load the data from the package data(Exam, package="mlmRev") # invoke help document ?Exam # view first 6 lines head(Exam) schoo...

791 sym R (1265 sym/11 pcs) 1 img

0914 class_ex

14.09.2020

Data management In this section, we load the exam scores data set, activate the help page for it, and examine the first 6 lines of the data frame object. # load the package to working directory library(mlmRev) # load the data from the package data(Exam, package="mlmRev") # invoke help document ?Exam # view first 6 lines head(Exam) school no...

769 sym R (1265 sym/11 pcs) 1 img

in-class ex 6

18.09.2020

0.1 Data management # install.package("mlmRev") library(mlmRev) # load the data from the package data(Gcsemv, package="mlmRev") # invoke help document ?Gcsemv # view first 6 lines head(Gcsemv) school student gender written course 1 20920 16 M 23 NA 2 20920 25 F NA 71.2 3 20920 27 F 39...

213 sym R (1151 sym/14 pcs) 1 img