Publications by Hao-Lun Fu
Week 10 Exercise (Date and Times)
Week 10 Exercise (Data&Time) Hao-Lun Fu 2020-05-25 In-Class Exercise 1: ROC (Taiwan) Students in the U.S.A (1950-2004) ## ─ Attaching packages ────────────────────────── tidyverse 1.3.0 ─ ## ✓ tibble 3.0.1 ✓ dplyr 0.8.5 ## ✓ tidyr 1.0.3 ✓ stringr 1.4.0 ## ✓ readr 1....
1503 sym R (6452 sym/41 pcs) 7 img
Multilevel Models: Homework exercises
1 Homework 1: Use the models specified in the IQ and language example to replicate the results of analysis. 1.1 Load data file pacman::p_load(mlmRev, tidyverse, lme4) dta <- read.table('data/Homework.txt', header = T) head(dta) School Pupil IQ Language Group_size IQ_c School_mean Group_mean SES_c 1 1 17001 15.0 46 2...
1210 sym R (6469 sym/25 pcs) 4 img
Analysis of Variance: Homework exercises
1 Homework 1: Perform an analysis of the anorexia data example following the paired or independent samples example in the course note. You can start with this R script . 1.1 Load data file library(PairedData) # data(Anorexia, package="PairedData") dta <- Anorexia head(dta) Prior Post 1 83.8 95.2 2 83.3 94.3 3 86.0 91.5 4 82.5 91.9 5 ...
2517 sym R (15727 sym/68 pcs) 12 img
Analysis of Variance: In-class exercises
1 In-class exercises 1: Assess how similar family members are in their ratings of liberalism in the family example using the intraclass correlation. 1.1 Load data file # pacman::p_load(tidyverse, lme4) # dta <- read.table("./data/family.txt", header = T) # data structure str(dta) 'data.frame': 12 obs. of 2 variables: $ family : int 1 1...
2114 sym R (7563 sym/47 pcs) 2 img
Regression: Homework
1 Homework 1: Edit the R script with your own comments to explain what each code chunk does and then compile a report of the script in html for publication to moodle. 1.1 example of regression with sampling weights ## set some options options(digits=3, show.signif.stars=FALSE) ## load packages pacman::p_load(alr4, tidyverse) 1.2 load data data(...
5109 sym R (19690 sym/80 pcs) 14 img
Regression: In-class exercises
1 In-class exercises 1: Complete the regression analysis of the blood pressure data from the Framingham Heart Study in the R script . In there a gender difference in regression slopes? 1.1 data management fL<-"https://math.montana.edu/shancock/data/Framingham.txt" dta <- read.table(fL, header=T) # recode gender variable dta$sex <- factor(dta$s...
6119 sym R (13178 sym/68 pcs) 11 img
R for Multilevel Analysis - Homework
1 Homework 1: Draw a scatter plot of the variables written and course scores from the data set Gcsemv{mlmRev} and superimpose another scatter plot on it using mean written and mean course scores by school as in the language and math example. You can start by editing in RStudio either the gcsemv rmarkdown or the exam rmarkdown file. 1.1 Data mana...
1645 sym R (8752 sym/41 pcs) 4 img
R for Multilevel Analysis- In-class Exercises
1 In-class exercises 3: 1.1 Introduction Kreft and de Leeuw (1998) obtained a sub-sample of students in eighth grade from the National Education Longitudinal Study of 1988 (NELS–88) collected by the National Center for Educational Statistics of the U.S. Department of Education. The students are nested in schools. Here, we consider the followin...
3029 sym R (8264 sym/57 pcs) 11 img
Multilevel Models: In-class exercises
1 In-class exercises 1: Replicate the results of analysis reported the high school and beyond - null 2 3 4 examples. 1.1 Load data file pacman::p_load(mlmRev, tidyverse, lme4) # data from mlmRev package data(Hsb82, "mlmRev") # str(Hsb82) 'data.frame': 7185 obs. of 8 variables: $ school : Ord.factor w/ 160 levels "8367"<"8854"<..: 59 59 59 ...
3813 sym R (36684 sym/75 pcs) 10 img
Generalized Linear Models: In-class exercises
1 In-class exercises 1: Replicate the analysis reported in the brightness discrimination example. Consider the outcome of a brightness discrimination experiment. On each trial, two patches of light were presented: one was a standatd with an intensity of 35 units, and another was a variable intensity comparison light. The subject was asked to indi...
3301 sym R (6294 sym/40 pcs) 4 img