Publications by jenny hsu
1130hw4
1 data input dta <- read.table("C:/Users/user/Desktop/multilevel/1130/mathPlacement.asc.txt", h=T) names(dta) <- c("ID", paste("Item", 1:35, sep = "")) str(dta) ## 'data.frame': 199 obs. of 36 variables: ## $ ID : int 2 3 4 5 6 7 8 9 10 11 ... ## $ Item1 : int 1 1 1 1 1 0 0 1 0 1 ... ## $ Item2 : int 1 1 1 1 1 1 0 0 0 1 ... ## ...
14747 sym R (5725 sym/21 pcs) 3 img
1130hw3
1 daya dta3 <- read.table("planes.txt", h=T) dta3$ID <- as.factor(dta3$ID) str(dta3) ## 'data.frame': 252 obs. of 3 variables: ## $ ID : Factor w/ 28 levels "S11","S12","S13",..: 1 1 1 1 1 1 1 1 1 2 ... ## $ Trial: int 1 2 3 4 5 6 7 8 9 1 ... ## $ Plane: int 39 40 47 51 52 50 60 52 56 38 ... head(dta3) ## ID Trial Plane ## 1...
249 sym R (6064 sym/22 pcs) 7 img
1130hw1
1 load package pacman::p_load(lattice, tidyverse, nlme, nlstools) 2 input data dta1 <- read.table("freeRecall.asc.txt", header = T) names(dta1) <- c("Group","Trial","CorrectN") str(dta1) ## 'data.frame': 20 obs. of 3 variables: ## $ Group : chr "C" "C" "C" "C" ... ## $ Trial : int 1 2 3 4 5 6 7 8 9 10 ... ## $ CorrectN: num ...
189 sym R (2597 sym/10 pcs) 2 img
1130inclass3
1 setting options(digits = 4, show.signif.stars = FALSE) # load package for later use - must have pacman installed first pacman::p_load(tidyverse, nlme, car) 2 data input # check the data set ?Wong ## starting httpd help server ... done # save a copy dta <- Wong # check data structure str(dta) ## 'data.frame': 331 obs. of 7 variables...
300 sym R (5458 sym/20 pcs) 4 img
1123hw2
1 data input dta2 <- read.table("pirls_us.txt", h=T) names(dta2) <- c("School", "Gender", "US", "TVtime", "Economic", "Reading", "Enjoy") 2 data management library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base'...
82 sym R (6245 sym/19 pcs) 1 img
1123hw1
1 data input dta4 <- read.table("adolescentSmoking.txt", h=T) names(dta4) <- c("ID","sex","parent","wave","smoke") str(dta4) ## 'data.frame': 8730 obs. of 5 variables: ## $ ID : int 1 1 1 1 1 2 2 2 2 2 ... ## $ sex : int 1 1 1 1 1 0 0 0 0 0 ... ## $ parent: int 0 0 0 0 0 0 0 0 0 0 ... ## $ wave : int 1 2 4 5 6 1 2 3 4 5 .....
145 sym R (6246 sym/22 pcs) 1 img
1123inclass1
1 data input - long form dta <- read.table("starter.txt", h=T) names(dta) <- c("ID","Item","Response") str(dta) ## 'data.frame': 1350 obs. of 3 variables: ## $ ID : int 1 1 1 1 1 1 1 1 1 2 ... ## $ Item : int 1 2 3 4 5 6 7 8 9 1 ... ## $ Response: int 1 1 1 1 1 1 1 1 0 1 ... head(dta) ## ID Item Response ## 1 1 1 ...
2230 sym R (2596 sym/32 pcs) 5 img
1123inclass3
1 data input # load or install packages to be used pacman::p_load(tidyverse, lme4, glmmTMB, bbmle) dta3 <- read.csv("rapi.csv") names(dta3) <- c("ID","Time","Gender", "Month", "RAPI") str(dta3) ## 'data.frame': 3616 obs. of 5 variables: ## $ ID : chr "S1001" "S1001" "S1001" "S1002" ... ## $ Time : int 1 2 3 1 2 3 4 5 1 2 ... ...
321 sym R (13275 sym/44 pcs) 8 img
1123inclass2
1 data input # mixed-effects cumulative logit model (proportional odds) # loading package pacman::p_load(tidyverse, HH, ordinal) dta2 <- read.table("C:/Users/user/Desktop/multilevel/1123/teach_again.txt", h=T) head(dta2) ## Answer Task School ## 1 Yes -0.2642783 S01 ## 2 Yes 0.5709041 S01 ## 3 Yes 0.1329710 S0...
286 sym R (6053 sym/28 pcs) 6 img
1109hw1
1 data input fL <- "https://content.sph.harvard.edu/fitzmaur/ala2e/muscatine-data.txt" dta <- read.table(fL, h=F, na.strings = '.') names(dta) <- c("ID","Gender","Age0","Age","Occasion","Obese") head(dta) ## ID Gender Age0 Age Occasion Obese ## 1 1 0 6 6 1 1 ## 2 1 0 6 8 2 1 ## 3 1 0 ...
955 sym R (6641 sym/19 pcs) 2 img