Publications by jenny hsu

1005hw3

11.10.2020

1 data input # load package pacman::p_load(mlmRev, tidyverse, lme4, nlme) # input data dta1 <- read.table("demo1.txt", header = T) dta2 <- read.table("demo2.txt", header = T) 2 grand mean and sd # grand mean summary(dta1$Score) ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 11.00 51.00 55.00 62.11 93.00 97.00 summary(dt...

901 sym R (1891 sym/14 pcs)

1012inclass3

18.10.2020

1 Load package pacman::p_load(mlmRev, tidyverse, lme4, foreign, merTools, sjPlot) # download a copy of data from the following link and save it to the # data folder # https://content.sph.harvard.edu/fitzmaur/ala2e/fat.dta 2 Input data and management dta <- read.dta("fat.dta") # rename names(dta) <-c("ID", "Age", "Age_m", "Time", "PBF") # s...

1149 sym R (5473 sym/23 pcs) 6 img

1012hw1

18.10.2020

1 data input dta <- read.csv("visual_search.csv") head(dta) ## Participant Dx Set.Size RT ## 1 9129 Control 1 786.50 ## 2 9051 Control 1 935.83 ## 3 9126 Control 1 750.83 ## 4 9171* Control 1 1129.50 ## 5 9176 Control 1 1211.33 ## 6 9167 Control ...

479 sym R (3809 sym/16 pcs) 3 img

1012hw3

18.10.2020

1 data input dta <- read.table("alcohol_use.txt", header = T) head(dta) ## sid coa sex age14 alcuse peer cpeer ccoa ## 1 1 1 0 0 1.73205 1.26491 0.24691 0.549 ## 2 1 1 0 1 2.00000 1.26491 0.24691 0.549 ## 3 1 1 0 2 2.00000 1.26491 0.24691 0.549 ## 4 2 1 1 0 0.00000 0.89443 -0.12357 0.549 ...

2011 sym R (5224 sym/19 pcs)

1019hw3

26.10.2020

data input pacman::p_load(foreign) dta <- read.dta("bodyfat.dta", convert.dates = TRUE, convert.factors = TRUE, missing.type = FALSE, convert.underscore = FALSE, warn.missing.labels = TRUE) str(dta) ## 'data.frame': 2273 obs. of 4 variables: ## $ id...

163 sym R (2087 sym/8 pcs) 1 img

1019hw1

25.10.2020

1 data input # input data dta <- read.csv("claudication.csv", h = T) # see the data structure str(dta) ## 'data.frame': 38 obs. of 8 variables: ## $ Treatment: chr "ACT" "ACT" "ACT" "ACT" ... ## $ PID : chr "P101" "P105" "P109" "P112" ... ## $ Gender : chr "M" "M" "M" "M" ... ## $ D0 : int 190 98 155 245 182 140 1...

118 sym R (9139 sym/30 pcs) 1 img

1019inclass3

25.10.2020

1 load package pacman::p_load(tidyverse, nlme, car) 2 input data and management dta <- read.csv("fev_smoker.csv", h = T) # see the data structure str(dta) ## 'data.frame': 771 obs. of 4 variables: ## $ ID : chr "P1" "P1" "P1" "P1" ... ## $ Smoker: chr "Former" "Former" "Former" "Former" ... ## $ Time : int 0 3 6 9 15 19 0 3 6...

407 sym R (28949 sym/37 pcs) 4 img

1019inclass2

25.10.2020

1 load package pacman::p_load(tidyverse, nlme) 2 data input and management # data input dta <- read.csv("ade.csv") # see the data structure str(dta) ## 'data.frame': 60 obs. of 3 variables: ## $ Dog : chr "D11" "D11" "D11" "D11" ... ## $ Hour: num 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 ... ## $ ADE : num 5.7 4.7 4.8 4.9 3.88 3.51 2.8 2.6...

160 sym R (8405 sym/23 pcs) 2 img

1019inclass4

25.10.2020

pacman::p_load(knitr, simstudy, tidyverse, nlme, rms) 1 The study An experiment was conducted to study two new reading programs in the fourth grade. Thirty subjects were randomly assigned to three conditions: a control (traditional program), and two experimental programs. Before the study took place, a test was administered to obtain grade-equiv...

3810 sym R (3527 sym/16 pcs) 3 img

1019hw2

25.10.2020

1 data input # input data dta <- read.table("adas.txt", h = T, na.strings='.') # see the data structure str(dta) ## 'data.frame': 80 obs. of 8 variables: ## $ Treatment: chr "L" "L" "L" "L" ... ## $ PID : int 1 5 8 12 13 15 19 21 24 28 ... ## $ adas02 : int 22 34 40 24 29 31 22 43 18 25 ... ## $ adas04 : int 30 35 41 N...

1093 sym R (4552 sym/20 pcs) 2 img