Publications by jenny hsu

1109inclass1

20.11.2020

1 load package pacman::p_load(MASS, gee, tidyverse, geepack) 2 input data fL <- "https://www.hsph.harvard.edu/fitzmaur/ala2e/ccs-data.txt" dta <- read.table(fL, na.string = ".") 3 data management names(dta) <- c("ID", "Problem", "Single", "Parent", "Teacher") head(dta) ## ID Problem Single Parent Teacher ## 1 1 1 1 0 ...

451 sym R (5868 sym/25 pcs) 2 img

1102hw3

08.11.2020

1 input data data(knee, package="catdata") dta3<-knee head(dta3) ## N Th Age Sex R1 R2 R3 R4 ## 1 1 1 28 1 4 4 4 4 ## 2 2 1 32 1 4 4 4 4 ## 3 3 1 41 1 3 3 3 3 ## 4 4 2 21 1 4 3 3 2 ## 5 5 2 34 1 4 3 3 2 ## 6 6 1 24 1 3 3 3 2 str(dta3) ## 'data.frame': 127 obs. of 8 variables: ## $ N ...

150 sym R (6532 sym/45 pcs) 2 img

1102inclass3

08.11.2020

1 load package pacman::p_load(tidyverse, MASS, HH) 2 data input dta <- read.table("mentalSES.txt", h = T) head(dta) ## Id ses A B C D E mental ## 1 1 6 1 0 0 0 0 1 ## 2 2 6 1 0 0 0 0 1 ## 3 3 6 1 0 0 0 0 1 ## 4 4 6 1 0 0 0 0 1 ## 5 5 6 1 0 0 0 0 1 ## 6 6 6 1 0 0 0 0 1 str(dta) ## 'data.fra...

237 sym R (5171 sym/31 pcs) 3 img

Document

06.11.2020

#load package pacman::p_load(tidyverse, MASS, nnet) #input data dta <- read.table("youth_employment.txt", h=T) head(dta) ## Employment Race Family DadEdu Income Local ASAB ## 1 Work Others Non-Intact Otherwise 0.4909 6.9 -0.110 ## 2 School Others Non-Intact Otherwise 0.6940 4.8 0.452 ## 3 Work Others Otherw...

1874 sym R (11288 sym/32 pcs) 4 img

1102inclass1

06.11.2020

1 load packages pacman::p_load(tidyverse, MASS, pscl) 2 input data dta <- read.table("bullying.txt", h=T) # first 6 lines head(dta) ## Score Nomination ## 1 1.56 0 ## 2 1.56 0 ## 3 1.11 0 ## 4 1.56 0 ## 5 1.22 4 ## 6 1.33 0 # check data structure str(dta) ## 'data.frame': ...

925 sym R (6013 sym/28 pcs) 4 img

1026hw3

01.11.2020

1 input data dtahw3 <- read.csv("nes_2008.csv") str(dtahw3) ## 'data.frame': 26 obs. of 4 variables: ## $ Age : int 18 21 25 30 36 40 45 50 55 60 ... ## $ Married: int 0 0 0 0 0 0 0 0 0 0 ... ## $ No : int 164 126 83 85 51 38 47 63 53 41 ... ## $ Yes : int 11 153 179 134 128 148 138 220 228 198 ... head(dtahw3) ## Age...

240 sym R (6802 sym/31 pcs) 3 img

1026hw2

01.11.2020

1 input data dtahw2 <- read.csv("days_absent.csv") head(dtahw2) ## ID Gender Program Math Days ## 1 S1001 male Academic 63 4 ## 2 S1002 male Academic 27 4 ## 3 S1003 female Academic 20 2 ## 4 S1004 female Academic 16 3 ## 5 S1005 female Academic 2 3 ## 6 S1006 female Academic 71 13 str(dtahw2) ## 'da...

4160 sym R (3908 sym/29 pcs) 5 img

1026class3

01.11.2020

1 input data library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union dta3 <- read.csv("victims.csv") dta3 <- mutate(dta3, Race = factor(Race)) st...

1245 sym R (2654 sym/30 pcs) 1 img

1026class2

01.11.2020

1 input data load("ghq.rda") dta2 <- ghq head(dta2) ## sex ghq c nc ## 1 men 0 0 18 ## 2 men 1 0 8 ## 3 men 2 1 1 ## 4 men 3 0 0 ## 5 men 4 1 0 ## 6 men 5 3 0 2 Detecting mental illness by questionnaire library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## ...

1802 sym R (3685 sym/30 pcs) 4 img

1026class1

01.11.2020

1 input data dta <- read.table("brightness.txt", h=T) # head(dta) ## Stimulus Intensity Trial Yes ## 1 1 10 49 2 ## 2 2 20 48 3 ## 3 3 30 48 13 ## 4 4 40 50 31 ## 5 5 50 47 38 ## 6 6 60 49 48 2 observed proportions dta$Prop <-...

185 sym R (1729 sym/8 pcs) 1 img