datasets::warpbreaks

?warpbreaks  # warpbreaks 도움말 보기

# 아래는 example(warpbreaks) 입니다.

require(stats); require(graphics)
summary(warpbreaks)
opar <- par(mfrow = c(1, 2), oma = c(0, 0, 1.1, 0))
plot(breaks ~ tension, data = warpbreaks, col = "lightgray",
     varwidth = TRUE, subset = wool == "A", main = "Wool A")
plot(breaks ~ tension, data = warpbreaks, col = "lightgray",
     varwidth = TRUE, subset = wool == "B", main = "Wool B")
mtext("warpbreaks data", side = 3, outer = TRUE)
par(opar)
summary(fm1 <- lm(breaks ~ wool*tension, data = warpbreaks))
anova(fm1)

Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)

'Dataset_info > warpbreaks' 카테고리의 다른 글

warpbreaks 데이터셋  (0) 2022.03.20

datasets::USArrests()

?USArrests  # USArrests 데이터셋 도움말 보기

# 아래는 example(USArrests) 입니다.

summary(USArrests)

require(graphics)
pairs(USArrests, panel = panel.smooth, main = "USArrests data")

## Difference between 'USArrests' and its correction
USArrests["Maryland", "UrbanPop"] # 67 -- the transcription error
UA.C <- USArrests
UA.C["Maryland", "UrbanPop"] <- 76.6

## also +/- 0.5 to restore the original  <n>.5  percentages
s5u <- c("Colorado", "Florida", "Mississippi", "Wyoming")
s5d <- c("Nebraska", "Pennsylvania")
UA.C[s5u, "UrbanPop"] <- UA.C[s5u, "UrbanPop"] + 0.5
UA.C[s5d, "UrbanPop"] <- UA.C[s5d, "UrbanPop"] - 0.5

Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)

# USArrests 원자료를 수정한 UA.C 데이터셋

pairs(UA.C, panel = panel.smooth, main = "USArrests data (corrected)")

Linux 사례 (MX 21)

'Dataset_info > USArrests' 카테고리의 다른 글

USArrests 데이터셋  (0) 2022.03.08

datasets::sleep()

?sleep #sleep 데이터셋 도움말 보기

# 아래는 example(sleep) 입니다.

require(stats)
## Student's paired t-test
with(sleep,
     t.test(extra[group == 1],
            extra[group == 2], paired = TRUE))

## The sleep *prolongations*
sleep1 <- with(sleep, extra[group == 2] - extra[group == 1])
summary(sleep1)
stripchart(sleep1, method = "stack", xlab = "hours",
           main = "Sleep prolongation (n = 10)")
boxplot(sleep1, horizontal = TRUE, add = TRUE,
        at = .6, pars = list(boxwex = 0.5, staplewex = 0.25))

Linux 사례 (MX 21)
Linux 사례 (MX 21)
Linux 사례 (MX 21)

Linux 사례 (MX 21)

'Dataset_info > sleep' 카테고리의 다른 글

sleep 데이터셋  (0) 2022.03.07

+ Recent posts