Publications by jenny hsu

1012inclass2

18.10.2020

1 Data input library(lme4) ## Loading required package: Matrix library(ggplot2) data(sleepstudy, package="lme4") dim(sleepstudy) ## [1] 180 3 head(sleepstudy) ## Reaction Days Subject ## 1 249.5600 0 308 ## 2 258.7047 1 308 ## 3 250.8006 2 308 ## 4 321.4398 3 308 ## 5 356.8519 4 308 ## 6 414.6901 ...

234 sym R (5078 sym/34 pcs) 3 img

1012inclass1

18.10.2020

The data consist of weight gains of 68 Asian children in a British community. Measurements of weight were recorded for children on up to five occasions visiting a clinic. The ages at which the measurements were taken are roughly to target examination dates of 6 weeks, then 8, 12, 27 months. 1 load package pacman::p_load(tidyverse, afex, segmente...

711 sym R (8937 sym/30 pcs) 4 img

1012hw2

18.10.2020

1 data input dta <- read.table("reading_piat.txt", header = T) head(dta) ## ID Wave Age_G Age PIAT ## 1 1 1 6.5 6.0000 18 ## 2 1 2 8.5 8.3333 35 ## 3 1 3 10.5 10.3333 59 ## 4 2 1 6.5 6.0000 18 ## 5 2 2 8.5 8.5000 25 ## 6 2 3 10.5 10.5833 28 str(dta) ## 'data.frame': 267 obs. of 5 ...

1108 sym R (4096 sym/21 pcs) 1 img

1005hw1

11.10.2020

1 data input # load package pacman::p_load(mlmRev, tidyverse, lme4, nlme) # input data dta <- read.table("iq_language.txt", header = T) # head(dta) ## School Pupil IQ Language Group_size IQ_c School_mean Group_mean ## 1 1 17001 15.0 46 29 3.1659379 -1.51406 5.9 ## 2 1 17002 14.5 45 ...

1050 sym R (2327 sym/7 pcs)

1005inclass2

11.10.2020

# Understand the meaning of predictors at different levels # as well as the effect of the centering the teacher level # predictor against the respective school-level means in a # school-teacher-pupil three-level example 0.1 load package # package management library(pacman) # load them pacman::p_load(mlmRev, tidyverse, lme4, merTools) 0.2...

261 sym R (13148 sym/32 pcs) 5 img

0928HW3

04.10.2020

1 data input pacman::p_load(car, tidyverse, lme4, GGally) dta3 <- read.table("thetaEEG.txt", header = T) str(dta3) ## 'data.frame': 19 obs. of 10 variables: ## $ ID : int 1 2 3 4 5 6 7 8 9 10 ... ## $ Ch3 : num -3.54 5.72 0.52 0 2.07 1.67 9.13 -0.43 -0.56 1.28 ... ## $ Ch4 : num -3.11 5.07 -0.18 0.74 0.76 ... ## $ Ch5 : num -0....

380 sym R (18833 sym/34 pcs) 7 img

0928hw4

04.10.2020

1 input data dta <- read.table("cognitive_task.txt", h=T) str(dta) ## 'data.frame': 32 obs. of 5 variables: ## $ ID : chr "S01" "S02" "S03" "S04" ... ## $ Score : int 3 6 3 3 1 2 2 2 5 6 ... ## $ Method: chr "I1" "I1" "I1" "I1" ... ## $ Class : chr "C1" "C1" "C1" "C1" ... ## $ Klass : chr "K1" "K1" "K1" "K1" ... head(dta) #...

455 sym R (3861 sym/21 pcs) 1 img

0928HW2

04.10.2020

1 load package library(nlme) 2 input data data(ergoStool, package="nlme") str(ergoStool) ## Classes 'nffGroupedData', 'nfGroupedData', 'groupedData' and 'data.frame': 36 obs. of 3 variables: ## $ effort : num 12 15 12 10 10 14 13 12 7 14 ... ## $ Type : Factor w/ 4 levels "T1","T2","T3",..: 1 2 3 4 1 2 3 4 1 2 ... ## $ Subject: Ord....

154 sym R (4794 sym/23 pcs)

0928inclass_ex2

01.10.2020

0.1 input Data dta <- read.csv('Chicano.csv', stringsAsFactors = TRUE) 0.2 load package pacman::p_load(tidyverse, VCA, lme4, nlme) 0.3 varPlot by Trt/Class/Pupil VCA::varPlot(Score ~ Trt/Class/Pupil, Data=dta, YLabel=list(text="Score", side=2, cex=1), ...

817 sym R (1902 sym/13 pcs) 1 img

0928inclass_ex1

01.10.2020

0.1 data management #load library pacman::p_load(tidyverse, lme4) #input data dta <- read.table("family.txt", header = T) # data structure str(dta) ## 'data.frame': 12 obs. of 2 variables: ## $ family : int 1 1 1 2 2 2 2 3 3 4 ... ## $ liberalism: int 25 29 34 18 21 21 26 31 35 30 ... # first 6 lines head(dta) ## family liber...

881 sym R (4911 sym/22 pcs)