Publications by Li-Hsin Chien

迴歸模型 logistic regression

28.11.2023

Heart Disease Example 3154 healthy young men aged 39-59 from the San Francisco area were assessed for their personality type. All were free from coronary heart disease at the start of the research. Eight and a half years later change in this situation was recorded. library(faraway) ## Warning: 套件 'faraway' 是用 R 版本 4.3.1 來建造的 ...

1334 sym R (8593 sym/68 pcs) 4 img

迴歸模型 ch11

31.10.2023

(#11.3&4) Ridge Regression & Lasso The ridge regression estimate chooses the \(\beta\) that minimizes: \[ (y-X\beta)^T(y-X\beta) + \lambda \sum_j \beta_j^2 \] or minimizes \[ (y-X\beta)^T(y-X\beta) ~~\text{subject to}~~ \sum_{j=1}^p \beta_j^2 \leq t\] The lasso regression estimate chooses the \(\beta\) that minimizes: \[ (y-X\beta)^T(y-X\beta) +...

976 sym R (3086 sym/26 pcs) 2 img

迴歸模型 ch10

31.10.2023

(#10.2) One-at-a-time variable selection cut-off p-value: \(\alpha_{crit}\) Forward Selection Backward selection Stepwise Regression 1. Backward selection library(faraway) ## Warning: 套件 'faraway' 是用 R 版本 4.3.1 來建造的 data(state) statedata <- data.frame(state.x77,row.names=state.abb) lmod <- lm(Life.Exp ~ ., statedata) summar...

775 sym R (8122 sym/25 pcs) 3 img

迴歸模型 ch4 prediction (2023.10.14)

14.10.2023

Textbook: Linear Models with R, 2nd, Julian J. Faraway Prediction data(fat,package="faraway") Dataset: Percentage of Body Fat and Body Measurements Description Age, weight, height, and 10 body circumference measurements are recorded for 252 men. Each man’s percentage of body fat was accurately estimated by an underwater weighing technique. he...

1822 sym

迴歸模型 ch6 (2023.10.17)

17.10.2023

Textbook: Linear Models with R, 2nd, Julian J. Faraway Diagnostics Dataset: Savings rates in 50 countries Description The savings data frame has 50 rows and 5 columns. The data is averaged over the period 1960-1970. data(savings,package="faraway") #?savings head(savings) ## sr pop15 pop75 dpi ddpi ## Australia 11.43 29.35 2....

2777 sym R (4007 sym/29 pcs) 17 img

Tree & Random Forest-2023.10.01

01.10.2023

Decision Tree x0<-c(4.3,3.9,2.7,6.6,6.5,2.7) x1<-c(4.9,6.1,4.8,4.4,2.9,6.7) x2<-c(4.1,5.9,4.1,4.5,4.7,4.2) x3<-c(4.7,5.5,5.0,3.9,4.6,5.3) x4<-c(5.5,5.9,5.6,5.9,6.1,4.8) y<-as.factor(c(0,0,0,1,1,1)) #y<-(c(0,0,0,1,1,1)) id<-1:6 (data<-data.frame(x0,x1,x2,x3,x4,y)) ## x0 x1 x2 x3 x4 y ## 1 4.3 4.9 4.1 4.7 5.5 0 ## 2 3.9 6.1 5.9 5.5 5...

61 sym R (4412 sym/22 pcs) 4 img

迴歸分析 ch3 (2023.09.26)

26.09.2023

Textbook: Linear Models with R, 2nd, Julian J. Faraway Hypothesis tests to compare models 1. Test of all the predictors \[y=X\beta + \varepsilon\] \(\beta = (\beta_0, \beta_1,...,\beta_{p-1})'\) \[H_0: \beta_1 = ... = \beta _{p-1}=0\] data(gala, package="faraway") lmod <- lm(Species ~ Area + Elevation + Nearest + Scruz + Adjacent, gala) \(anov...

637 sym 1 img

迴歸模型 ch3-1 (2023.09.26)

26.09.2023

Textbook: Linear Models with R, 2nd, Julian J. Faraway Hypothesis tests to compare models 1. Test of all the predictors \[y=X\beta + \varepsilon\] \(\beta = (\beta_0, \beta_1,...,\beta_{p-1})'\) \[H_0: \beta_1 = ... = \beta _{p-1}=0\] data(gala, package="faraway") lmod <- lm(Species ~ Area + Elevation + Nearest + Scruz + Adjacent, gala) \(anov...

594 sym 1 img

迴歸模型 R 指令 2023.09.19

19.09.2023

安裝套件、資料讀入、輸出 教科書: Linear Models with R, 2nd, Julian J. Faraway 這本書裡的例子可以從 R 的套件 “faraway” 找到。 rm(list=ls()) #清空工作空間的變數 getwd() #查看目前工作路徑 ## [1] "D:/course/112-1/regression model/markdown" setwd("C:/Users/USER/Desktop/tmp") #設定工作路徑 #ins...

199 sym R (4998 sym/74 pcs)

迴歸模型 ch2 (2023.09.17)

17.09.2023

Textbook: Linear Models with R, 2nd, Julian J. Faraway 1. Least Square Estimation data(gala, package="faraway") ? gala ## 在指定的程式套件和圖書館裡沒有與 'gala' 有關的說明書: ## 您可以用用 '??gala' 資料gala: Description: There are 30 Galapagos islands (加拉巴哥群島) and 7 variables in the dataset. The relat...

1898 sym 2 img