Publications by Ching-Fang Wu
Week6 In-class exercises 3
# load them 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 # input data dta <- read.dta("https://content.sph.harvard.edu/fitzmaur/ala2e/fat.dta") # 將變數重新命名 names(dta) <-...
941 sym R (5943 sym/26 pcs) 6 img
Week6 In-class exercises 2
To study the impact of sleep deprivation on cognitive performance, a sample of 18 truck drivers were allowed only 3 hours of sleep during 10 consecutive days and their reaction times were measured several times each day. Source: Belenky, G., Wesensten, N.J., Thorne, D.R., Thomas, M.L., Sing, H.C., Redmond, D.P., Russo, M.B., & Balkin, T.J. (2003)...
1344 sym R (3661 sym/31 pcs) 1 img
W5 Homework 2
In this data set, the variable year is nested within students (the variable cid), and students are nested within schools (the variable school). There are 60 schools. The focus here is to examine the annual changes in math scores (math) of students within schools. 1 load them pacman::p_load(foreign, tidyverse, lme4, merTools) 2 file location fLo...
1129 sym R (3872 sym/20 pcs) 4 img
W5 Homework 1
The data set is concerned with grade 8 pupils (age about 11 years) in elementary schools in the Netherlands. The number of pupils is 2287, and the number of schools is 131. Class sizes are from 4 to 35. The question of interest is how the language test score depends on the pupil’s intelligence and his family’s socio-economic status, and on so...
2068 sym R (3625 sym/15 pcs)
W5 in-class exercise 1-3
1 load packages pacman::p_load(mlmRev, tidyverse, lme4)#pacman::p_load()同時取代install.packages()及library(),功能與p_load()一樣 1.1 data from mlmRev package data(Hsb82) 1.2 first 10 lines head(Hsb82,10) ## school minrty sx ses mAch meanses sector cses ## 1 1224 No Female -1.528 5.876 -0.434383 Public ...
1730 sym R (27292 sym/40 pcs) 3 img
W4 homework 2
#Problem An experimenter wishes to compare 4 particular type of stools. Each of nine individuals randomly selected from a subject pool is asked to test the stools by recording the effort required to arise from each of 4 types of stools. #install packages #install.packages("nlme") library(nlme) #load data ergoStool{nlme} data(ergoStool, package="n...
432 sym R (2981 sym/17 pcs)
WEEK 4 in-class exercise 3
1 pacman::p_load(tidyverse, lme4) 2 input data dta <- read.table("C:/Users/Ching-Fang Wu/Documents/data/finger_ridges.txt", header = T) 3 coerce pair variable to factor type dta$Pair <- factor(dta$Pair) 4 show first 6 lines head(dta) ## Pair Twin_1 Twin_2 ## 1 1 71 71 ## 2 2 79 82 ## 3 3 105 99 ## 4 4 ...
334 sym R (2679 sym/18 pcs) 1 img
WEEK 3 homework 2
trial by trial reaction time data load packages pacman::p_load(languageR, lattice, tidyverse, nlme, lmtest) load data data(heid, package="languageR") heid$Trial <- as.numeric(unlist(apply(as.matrix(table(heid$Subject)), 1, seq))) query data info ?heid ## starting httpd help server ... done see first 6 lines of data head(heid) ## Subject ...
587 sym R (4721 sym/28 pcs) 4 img
WEEK3 in class exercise 3 Quantile regression
library(Brq) #load data data(USgirl, package="Brq") str(USgirl) ## 'data.frame': 4011 obs. of 2 variables: ## $ Age : num 14.74 1.76 15.38 12.76 15.73 ... ## $ Weight: num 85 12.2 59.4 38.6 47.9 ... plot(USgirl, pch='.', bty="n", xlim=c(0, 25), ylim=c(0, 150), xlab="Age (in years)", ylab="Body weight (in kg)"...
144 sym R (600 sym/8 pcs) 1 img
Document
file location fL<-"https://math.montana.edu/shancock/data/Framingham.txt" #input data dta <- read.table(fL, header=T) recode gender variable dta$sex <- factor(dta$sex, levels=c(1, 2), labels=c("M", "F")) lattice plot library(lattice) xyplot(sbp ~ dbp | sex, data=dta, cex=.5, type=c("p","...
246 sym R (1036 sym/10 pcs) 2 img