Publications by Hao-Lun Fu
Week 9 In-class exercise (Programming)
Week 9 In-class exercise (Programming) Hao-Lun Fu 2020-05-18 In-Class Exercise 1: The original function ci_norm <- function(n=100, nci=50, nRun=3, level=0.95, pause=0.05) { ci <- NULL z0 = qnorm(1 - (1 - level)/2) for ( j in 1:nRun ) { zbar <- colMeans(replicate(nci, rnorm(n))) zl <- zbar - z0 * 1/sqrt(n); zu <- zbar + z0 * 1...
800 sym R (8311 sym/37 pcs) 6 img
Week 8 Homework Exercise (Function)
Week 8 Homework exercise (Function) Hao-Lun Fu 2020-05-11 Homework 1: Load data file dta <- read.table("/Users/haolunfu/Documents/資料管理/week8/hs0.txt", header = T) head(dta) ## id female race ses schtyp prog read write math science socst ## 1 70 male white low public general 57 52 41 47 57 ## 2 121 female...
1585 sym R (13109 sym/54 pcs) 4 img
Week 8 In-Class Exercise (Function)
Week 8 In-class exercise (Function) Hao-Lun Fu 2020-05-11 In-Class Exercise 1: Each Chick Weight and Time Load data file dta <- as.data.frame(datasets::ChickWeight) head(dta) ## weight Time Chick Diet ## 1 42 0 1 1 ## 2 51 2 1 1 ## 3 59 4 1 1 ## 4 64 6 1 1 ## 5 76 8 1 1 ## ...
2841 sym R (51202 sym/96 pcs) 1 img
Milic et al., (2015) Time for a New Data Presentation Paradigm. PLOS Biology
Using R for the examples in "Beyond Bar and Line Graphs: Time for a New Data Presentation Paradigm’ What is this? Here I show how we can use R to reproduce the plots described in: Weissgerber TL, Milic NM, Winham SJ, Garovic VD. Beyond Bar and Line Graphs: Time for a New Data Presentation Paradigm. PLOS Biology, 2015:13. http://journals.plos....
9240 sym R (10014 sym/20 pcs) 10 img 3 tbl
Week 7 Homework exercise (Grammer)
Week 7 Homework (Grammer) Hao-Lun Fu 2020-05-09 Homework 1: Anxiety Statement Load data file ## Homework 1 library(tidyverse) ## ─ Attaching packages ────────────────────────── tidyverse 1.3.0 ─ ## ✓ ggplot2 3.2.1 ✓ purrr 0.3.3 ## ✓ tibble 2.1.3 ✓ dplyr 0.8.4 ## ✓ ti...
1625 sym R (11010 sym/39 pcs) 10 img
Week 6 Homework (Trellis)
Week 6 Homweork (Trellis) Hao-Lun Fu 2020-04-27 Homework 1: National Longitudinal Survey of Youth (NLSY) Load data file ## Homework1 library(lattice) library(tidyverse) ## ─ Attaching packages ────────────────────────── tidyverse 1.3.0 ─ ## ✓ ggplot2 3.2.1 ✓ purrr 0.3.3 ## ✓ ti...
1918 sym R (12152 sym/46 pcs) 19 img
Week 6 In-Class Exercise (Trellis)
Week 6 In-class exercise (Trellis) Hao-Lun Fu 2020-04-20 In-Class Exercise 1: Chapter 4 of Lattice Load data file VADeaths ## Rural Male Rural Female Urban Male Urban Female ## 50-54 11.7 8.7 15.4 8.4 ## 55-59 18.1 11.7 24.3 13.6 ## 60-64 26.9 20.3 37.0 ...
2337 sym R (10980 sym/49 pcs) 15 img
Week 6 In-class exercise (R base)
Week 6 In-class exercise (R base) Hao-Lun Fu 2020-04-18 Exercise 1: hist and Density Plot The raw plot x <- seq(-pi*2, 2*pi, .05) z <- dnorm(x) y <- dt(x, df=3) plot(x, z, type="l", bty="L", xlab="Standard unit", ylab="Density") polygon(c(x, rev(x)), c(y, rev(z)), col='aliceblue') lines(x, y, col='cadetblue') Change the ‘df’ parameter to a...
956 sym R (3723 sym/12 pcs) 66 img
Week 5 Homework 6
Week 5 Homework 6 Hao-Lun Fu 2020-04-13 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 library(foreign) library(mosaic) ## Loading required package: lattice ## ...
987 sym R (8682 sym/88 pcs)
Week 5 Homework
Week 5 Homework Hao-Lun Fu 2020-04-13 Exercise 1: Math score and Read score Load data file and set random seed set.seed(123) library(Ecdat) ## Loading required package: Ecfun ## ## Attaching package: 'Ecfun' ## The following object is masked from 'package:base': ## ## sign ## ## Attaching package: 'Ecdat' ## The following object is maske...
1340 sym R (8186 sym/52 pcs) 3 img