Publications by TJLee
Document
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 following subset of the variables:...
739 sym R (3423 sym/15 pcs) 4 img
Document
0.1 Data management In this section, we load the exam scores data set, activate the help page for it, and examine the first 6 lines of the data frame object. # load the package to working directory library(mlmRev) # load the data from the package data(Exam, package="mlmRev") # view first 6 lines head(Exam) school normexam schgend schavg ...
777 sym R (1236 sym/10 pcs) 1 img
Document
# input data dta <- read.table("http://www.amstat.org/publications/jse/datasets/sat.dat.txt") #assign variable names names(dta) <- c("State", "Expend", "Ratio", "Salary", "Frac", "Verbal", "Math", "Sat") # check data structure str(dta) ## 'data.frame': 50 obs. of 8 variables: ## $ State : Factor w/ 50 levels "Alabama...
18 sym R (2517 sym/9 pcs) 1 img
Document
# data management and graphics package library(tidyverse) ## -- Attaching packages ------------------------------------------ tidyverse 1.3.0 -- ## √ ggplot2 3.3.0 √ purrr 0.3.3 ## √ tibble 2.1.3 √ dplyr 0.8.5 ## √ tidyr 1.0.2 √ stringr 1.4.0 ## √ readr 1.3.1 √ forcats 0.5.0 ## -- Conflicts -----------...
12 sym R (1566 sym/9 pcs) 1 img
Document
1 in class exercise 1 1.1 file location fL<-"https://math.montana.edu/shancock/data/Framingham.txt" dta <- read.table(fL, header=T) 1.2 recode gender variable dta$sex <- factor(dta$sex, levels=c(1, 2), labels=c("M", "F")) 1.3 lattice plot library(lattice) xyplot(sbp ~ dbp | sex, data=dta, cex=...
1323 sym R (13294 sym/61 pcs) 11 img
Document
1 Hw exercise 1 example of regression with sampling weights # set some options options(digits=3, show.signif.stars=FALSE) load packages #載入packages pacman::p_load(alr4, tidyverse) load data #載入UN11這筆資料 data(UN11, package="alr4") #自己另外看這筆資料在處理什麼 ?UN11 ## starting httpd help server ... done seed the ...
476 sym R (3927 sym/24 pcs) 1 img
Document
1 Hw exercise 3 1.1 load and see data # regression with correlations over time and in clusters # set significant decimal points # handle package loading automatically # load packages pacman::p_load(tidyverse, nlme, broom, magrittr, MuMIn) # load data set girlheight<-read.csv("girl_height.csv", header= T) # grouped data structure from n...
551 sym R (5737 sym/25 pcs) 6 img
Document
1 In class Exercise1 1.1 load data pacman::p_load(tidyverse, lme4) dta <- read.table("family.txt", header = T) 1.2 see it str(dta) ## 'data.frame': 12 obs. of 2 variables: ## $ family : int 1 1 1 2 2 2 2 3 3 4 ... ## $ liberalism: int 25 29 34 18 21 21 26 31 35 30 ... # first 6 lines head(dta) ## family liberalism ## 1 1 ...
476 sym R (5159 sym/24 pcs)
Document
1 Homework1 # 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(tidyr) lib...
317 sym R (24719 sym/117 pcs) 13 img
Document
1 null library(nlme) library(lme4) ## Loading required package: Matrix ## ## Attaching package: 'lme4' ## The following object is masked from 'package:nlme': ## ## lmList library(tidyverse) ## -- Attaching packages ------------------------------------------ tidyverse 1.3.0 -- ## √ ggplot2 3.3.0 √ purrr 0.3.3 ## √ tibble 2....
2378 sym R (40263 sym/99 pcs) 14 img