Publications by jenny hsu
in-class ex 4
#愼㸵挼㹥.csv挼㸰ɮɡA愼㸵昼㹤戼㸸g愼㸵H愼㸴U愼㸸B挼㸶JŪ愼㸸昼㹡csv #step1:change work directory:session-set working directory #step2:change dta <- read.csv("langMath.csv", h=T) #愼㸵挼㹥.r挼㸰ɮɡA愼㸵昼㹤愼㸵ΥH愼㸴U戼㹢P愼㹡k挼㸲নrmd挼㸰挼㸹 #knitr::spin("langMath.R", knit=FALSE) # data ...
6 sym R (1398 sym/8 pcs) 1 img
hw1
0.1 Data management # install.package("mlmRev") library(mlmRev) # load the data from the package data(Gcsemv, package="mlmRev") 0.2 Summary statistics with(Gcsemv, cor(written, course, use="pairwise")) [1] 0.47417 # compute the means by school course_schavg <- with(Gcsemv, tapply(course, school, mean, na.rm=T)) written_schavg <- with(Gcsemv,...
79 sym R (718 sym/8 pcs) 1 img
in-class ex 4: AR Box
Open data #file location fL<-"https://gattonweb.uky.edu/sheather/book/docs/datasets/boxoffice.txt" dta <- read.table(fL, header=T) str(dta) ## 'data.frame': 32 obs. of 2 variables: ## $ GrossBoxOffice: num 95.3 86.4 119.4 124.4 154.2 ... ## $ year : int 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 ... 了解資料結構...
1273 sym R (3308 sym/28 pcs) 4 img
in class ex3: Quantile regression
0.1 load package library(Brq) library(ggplot2) 載入分析需要的套包 0.2 open data data(USgirl, package="Brq") 0.3 plot age and weight plot(USgirl, pch='.', bty="n", xlim=c(0, 25), ylim=c(0, 150), xlab="Age (in years)", ylab="Body weight (in kg)") 繪製年齡對體重的散佈圖。結果看起來,隨著年齡...
167 sym R (415 sym/4 pcs) 2 img
0921hw3
options(digits=4, show.signif.stars=FALSE) 0.1 load packages pacman::p_load(tidyverse, nlme, broom, magrittr, MuMIn) 0.2 data input and subdata gheight<-read.csv("girl_height.csv", header= T) str(gheight) ## 'data.frame': 100 obs. of 4 variables: ## $ Height: num 111 116 122 126 130 ... ## $ Girl : chr "G1" "G1" "G1" "G1" ... ## $...
1115 sym R (5166 sym/21 pcs) 5 img
0921hw4
0.1 data input dta <- read.table("course_eval.txt", h=T) str(dta) ## 'data.frame': 463 obs. of 7 variables: ## $ Score : num 4.3 4.5 3.7 4.3 4.4 4.2 4 3.4 4.5 3.9 ... ## $ Beauty : num 0.202 -0.826 -0.66 -0.766 1.421 ... ## $ Gender : int 1 0 0 1 1 0 1 1 1 0 ... ## $ Age : int 36 59 51 40 31 62 33 51 33 47 ... ## $ Mino...
151 sym R (6849 sym/16 pcs) 3 img
0928inclass_ex3
0.1 load package pacman::p_load(tidyverse, lme4) 0.2 input data dta <- read.table("finger_ridges.txt", header = T) str(dta) ## 'data.frame': 12 obs. of 3 variables: ## $ Pair : int 1 2 3 4 5 6 7 8 9 10 ... ## $ Twin_1: int 71 79 105 115 76 83 114 57 114 94 ... ## $ Twin_2: int 71 82 99 114 70 82 113 44 113 91 ... 0.3 coerce pair ...
1040 sym R (2856 sym/19 pcs) 1 img
0928HW1
0.1 load package library(PairedData) ## Loading required package: MASS ## Loading required package: gld ## Loading required package: mvtnorm ## Loading required package: lattice ## Loading required package: ggplot2 ## ## Attaching package: 'PairedData' ## The following object is masked from 'package:base': ## ## summary library(Hmisc) ##...
933 sym R (5125 sym/50 pcs) 2 img
1005inclass1
0.1 data input # pacman::p_load(mlmRev, tidyverse, lme4) # data from mlmRev package data(Hsb82, "mlmRev") ## Warning in data(Hsb82, "mlmRev"): data set 'mlmRev' not found # str(Hsb82) ## 'data.frame': 7185 obs. of 8 variables: ## $ school : Ord.factor w/ 160 levels "8367"<"8854"<..: 59 59 59 59 59 59 59 59 59 59 ... ## $ minrty : Fac...
349 sym R (38115 sym/88 pcs) 13 img
1005inclass3
0.1 data input library(WWGbook) data("classroom") head(classroom) ## sex minority mathkind mathgain ses yearstea mathknow housepov mathprep ## 1 1 1 448 32 0.46 1 NA 0.082 2.00 ## 2 0 1 460 109 -0.27 1 NA 0.082 2.00 ## 3 1 1 511 56 -0.03 ...
1439 sym R (7069 sym/30 pcs) 5 img