Publications by TJLee
Document
1 in class Exercise2 1.1 load data dta <- read.csv('Chicano.csv', stringsAsFactors = TRUE) str(dta) ## 'data.frame': 24 obs. of 4 variables: ## $ Pupil: Factor w/ 24 levels "P01","P02","P03",..: 1 2 3 4 5 6 7 8 9 10 ... ## $ Class: Factor w/ 6 levels "C1","C2","C3",..: 1 1 1 1 2 2 2 2 3 3 ... ## $ Trt : Factor w/ 2 levels "C","T": 2 ...
205 sym R (2041 sym/14 pcs) 1 img
Document
Hw exercise 4 #load data dta <- read.table("course_eval.txt", h=T) #Course type as factor dta$Course <- as.factor(dta$Course) #plot Score and Beauty by course library(lattice) xyplot(Score ~ Beauty | Course, data=dta, ylab="Average course evaluation score", xlab="Beauty judgment score", type=c("p", "g", "r")) libr...
37 sym R (6606 sym/13 pcs) 3 img
Document
1 Hw exercise 2 ##load and see data # trial by trial reaction time data # load packages pacman::p_load(languageR, lattice, tidyverse, nlme, lmtest) # load data data(lexdec, package="languageR") # query data info ?lexdec ## starting httpd help server ... done # see first 6 lines of data head(lexdec) ## Subject RT Trial Sex Nativ...
46 sym R (8449 sym/23 pcs) 4 img
Publish Document
#本提亦可使用reshape2(這題花了我5小時摸索) 1 input data dta <- read.csv("D:/sheu/nlsy86wide.csv") 2 inspect data structure str(dta) ## 'data.frame': 166 obs. of 23 variables: ## $ id : int 23901 25601 37401 40201 63501 70301 72001 76101 76801 77001 ... ## $ sex : Factor w/ 2 levels "Female","Male": 1 1 1 2 2...
210 sym R (5763 sym/16 pcs) 1 img
Publish Document
#本提亦可使用reshape2 # input data dta <- read.csv("D:/sheu/nlsy86wide.csv") 1 inspect data structure str(dta) ## 'data.frame': 166 obs. of 23 variables: ## $ id : int 23901 25601 37401 40201 63501 70301 72001 76101 76801 77001 ... ## $ sex : Factor w/ 2 levels "Female","Male": 1 1 1 2 2 2 2 2 1 2 ... ## $ race ...
196 sym R (5763 sym/16 pcs) 1 img
Document
0.1 Data management # install.package("mlmRev") library(mlmRev) # load the data from the package data(Gcsemv, package="mlmRev") # view first 6 lines head(Gcsemv) school student gender written course 1 20920 16 M 23 NA 2 20920 25 F NA 71.2 3 20920 27 F 39 76.8 4 20920 31 F...
93 sym R (1290 sym/13 pcs) 1 img
Document
In class exercise4 tjlee 2020-09-18 # 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 √ forc...
90 sym R (1141 sym/7 pcs) 1 img
Document
0.1 Introduction Ten subjects were played tones at each of 5 loudnesses, in random order. Subjects were asked to draw a line on paper whose length matched the loudness of the tone. Each subject repeated each loudness 3 times, for a total of 30 trials per subject. Here is the mean of the 3 log-lengths for each loudness, the sd of the three log-len...
997 sym R (1988 sym/13 pcs) 4 img
Document
0.1 Data management library(mlmRev) # load the data from the package data(Gcsemv, package="mlmRev") # view first 6 lines head(Gcsemv) school student gender written course 1 20920 16 M 23 NA 2 20920 25 F NA 71.2 3 20920 27 F 39 76.8 4 20920 31 F 36 87.9 5 20920 ...
79 sym R (1184 sym/13 pcs) 1 img
Document
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") # invoke help document ?Exam # view first 6 lines head(Exam) school no...
769 sym R (1310 sym/11 pcs) 1 img