楼主: oliyiyi
89218 2410

【latex版】水贴   [推广有奖]

2301
oliyiyi 发表于 2019-4-23 14:54:26
The book refers to many datasets that can be found in the “faraway” package that needs to be added to R. Windows and Macintosh users will find it most convenient to select the “Install packages from CRAN” option under the “Package” menu while running R, and then choose “faraway” from the list of packages. A source version of the package can be obtained from the R website.

2302
oliyiyi 发表于 2019-4-23 14:54:57
Windows and Macintosh users

2303
oliyiyi 发表于 2019-4-23 17:02:22
Windows and Macintosh users

2304
oliyiyi 发表于 2019-4-23 18:11:40
  1. data(wcgs, package="faraway")
  2. summary(wcgs[,c("chd","height","cigs")])
  3. plot(height ~ chd, wcgs)
  4. wcgs$y <- ifelse(wcgs$chd == "no",0,1)
  5. plot(jitter(y,0.1) ~ jitter(height), wcgs, xlab="Height",  ylab="Heart Disease", pch=".")
  6. library(ggplot2)
复制代码

2305
oliyiyi 发表于 2019-4-23 18:12:57
  1. ggplot(wcgs, aes(x=height, color=chd)) + geom_histogram(position="dodge", binwidth=1)
  2. ggplot(wcgs, aes(x=cigs, color=chd)) + geom_histogram(position="dodge", binwidth=5, aes(y=..density..))
  3. ggplot(wcgs, aes(x=height,y=cigs))+geom_point(alpha=0.2, position=position_jitter())+facet_grid(~ chd)
  4. library(faraway)
复制代码

2306
oliyiyi 发表于 2019-4-25 08:36:16
  1. data(orings, package="faraway")
  2. plot(damage/6 ~ temp, orings, xlim=c(25,85), ylim = c(0,1), xlab="Temperature", ylab="Prob of damage")
复制代码

2307
oliyiyi 发表于 2019-4-25 18:41:30

the linear mixed models

2308
oliyiyi 发表于 2019-4-25 19:41:26

the linear mixed models

2309
oliyiyi 发表于 2019-4-25 22:08:34
东岚香

2310
oliyiyi 发表于 2019-4-25 22:42:16
the linear mixed models

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-26 20:29