Publications by 張修語

0329HW

29.03.2022

#把檔案叫進來 vocdta <- read.csv("數據.csv", h = T) #改變項名稱 names(vocdta) <- c('ID','gender','T1','T2','T3') #轉換資料 #covert to long data vocldta <- pivot_longer(vocdta, cols = c(, 3:5), names_to = "time",values_to = "nvoc") #convert char to factor variable vocldta$time <- as.factor(vocldta$time) vocldta$ID <- as.factor(...

248 sym R (1110 sym/12 pcs) 3 img

0322_HW

22.03.2022

t.test(extra ~ group, data = sleep) ## ## Welch Two Sample t-test ## ## data: extra by group ## t = -1.8608, df = 17.776, p-value = 0.07939 ## alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0 ## 95 percent confidence interval: ## -3.3654832 0.2054832 ## sample estimates: ## mean in grou...

156 sym R (675 sym/4 pcs) 2 img

SPSS HW2

08.03.2022

install.packages("https://cran.rstudio.com/bin/windows/contrib/4.1/faraway_1.0.7.zip", repos = NULL) ## 將程式套件安載入 'C:/Users/user/Documents/R/win-library/4.1' ## (因為 'lib' 沒有被指定) ## package 'faraway' successfully unpacked and MD5 sums checked library(faraway) ## Warning: 套件 'faraway' 是用 R 版本 4.1.2 來建�...

42 sym R (2142 sym/33 pcs) 4 img

SSP_HW1

01.03.2022

#檔案地址 fLoc <- "https://cpcheng.neocities.org/Rbook/01/data/Quality_of_Life.txt" # 讀取檔案 dta <- read.table(file = fLoc, header = TRUE) #dta 的類型是資料框架(data frame) class(dta) ## [1] "data.frame" 看看dta維度: 多少行、多少欄(變項) dim(dta) ## [1] 2077 7 #利用names看看變項名稱 names(dta) #...

709 sym R (9103 sym/108 pcs) 5 img

W4 HW

08.03.2022

install.packages("https://cran.rstudio.com/bin/windows/contrib/4.1/faraway_1.0.7.zip", repos = NULL) ## 將程式套件安載入 'C:/Users/user/Documents/R/win-library/4.1' ## (因為 'lib' 沒有被指定) ## package 'faraway' successfully unpacked and MD5 sums checked library('faraway') ## Warning: 套件 'faraway' 是用 R 版本 4.1.2 來建...

47 sym R (6710 sym/28 pcs)

0315_HW3a

15.03.2022

前置作業 install.packages("https://cran.rstudio.com/bin/windows/contrib/4.1/faraway_1.0.7.zip", repos = NULL) ## 將程式套件安載入 'C:/Users/user/Documents/R/win-library/4.1' ## (因為 'lib' 沒有被指定) ## package 'faraway' successfully unpacked and MD5 sums checked library('faraway') ## Warning: 套件 'faraway' 是用 R 版本...

454 sym R (5522 sym/43 pcs) 7 img

0426HW

26.04.2022

檢視資料 dta <- read.csv("data.csv", h = T) names(dta) <- c('date','phone','ipad','workday','class','class.workshop.hour', 'free.hour','whole.free.hour') head(dta) ## date phone ipad workday class class.workshop.hour free.hour whole.free.hour ## 1 406 4.70 0.0 N N 0.0 12 24.0 ## 2 407 2.70 ...

727 sym R (3060 sym/18 pcs) 4 img

0524HW

24.05.2022

library('tidyverse') library('gtsummary') dta <- read.csv("0524dta.csv", h=T, stringsAsFactors = TRUE) str(dta) ## 'data.frame': 460 obs. of 14 variables: ## $ ID : int 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 ... ## $ Initial : Factor w/ 347 levels "BCT","BHC","BLC",..: 308 60 81 90 145 201 293 176 198 276 ... ...

1238 sym R (5489 sym/17 pcs) 1 tbl

0510 HW

10.05.2022

data(bfi) dta <- bfi 把資料整理成方便分析的形式 #每個分量表代表一個構念,每個分量表各有5題,其中有幾題是反向題,為了方便分析,需要reverse反向題。 keys <- list(agree=c("-A1","A2","A3","A4","A5"),conscientious=c("C1","C2","C3","-C4","-C5"), extraversion=c("-E1","-E2","E3","E4","E5"),ne...

1401 sym R (19920 sym/47 pcs) 6 img 1 tbl

0503 HW

03.05.2022

data(bfi) dta <- bfi 檢視資料 head(dta) ## A1 A2 A3 A4 A5 C1 C2 C3 C4 C5 E1 E2 E3 E4 E5 N1 N2 N3 N4 N5 O1 O2 O3 O4 ## 61617 2 4 3 4 4 2 3 3 4 4 3 3 3 4 4 3 4 2 2 3 3 6 3 4 ## 61618 2 4 5 2 5 5 4 4 3 4 1 1 6 4 3 3 3 3 5 5 4 2 4 3 ## 61620 5 4 5 4 4 4 5 4 2 5 2 4 4 4 5 4...

525 sym R (11605 sym/38 pcs) 4 img 1 tbl