Q1

The math attainment page has a dataset and a script of R code chunks. Generate a markdown file from the script to push the output in HTML for posting to course Moodle site.

input data

#first R session using math attainment data set

# read in a plain text file with variable names and assign a name to it
dta <- read.table("C:/Users/Ching-Fang Wu/Documents/dataM/math_attainment.txt", header = T)

checking data

# structure of data
str(dta)
## 'data.frame':    39 obs. of  3 variables:
##  $ math2: int  28 56 51 13 39 41 30 13 17 32 ...
##  $ math1: int  18 22 44 8 20 12 16 5 9 18 ...
##  $ cc   : num  328 406 387 167 328 ...

math attainment的資料結構為data.frame,稱作資料框架。

#查看資料
View(dta) 

用View()看資料框架,它是由直排的行(column)所組成,每一行代表一個變數。

# first 6 rows
head(dta)
##   math2 math1     cc
## 1    28    18 328.20
## 2    56    22 406.03
## 3    51    44 386.94
## 4    13     8 166.91
## 5    39    20 328.20
## 6    41    12 328.20

descriptive statistics

# variable mean
colMeans(dta) #colMeans顧名思義是行平均
##     math2     math1        cc 
##  28.76923  15.35897 188.83667
#試試看rowMeans(列平均)
rowMeans(dta)
##  [1] 124.73333 161.34333 160.64667  62.63667 129.06667 127.06667  68.76000
##  [8]  37.64667  41.40000 127.20667 126.73333  89.12000  79.45333  81.12000
## [15]  84.03667  56.08333  54.41667  90.51333  78.70333  24.24000  54.02667
## [22]  63.46333  37.75333  53.94000  85.14333  51.60667  64.75000  59.71667
## [29]  47.15667  57.60667  63.22333  79.47667  62.71667  74.38000  74.14333
## [36]  84.47667  81.89333  72.87000  55.27333
# variable sd
#apply sd to dta
apply(dta, 2, sd) #2是column;1是row
##     math2     math1        cc 
## 10.720029  7.744224 84.842513
# correlation matrix 相關係數矩陣
cor(dta) 
##           math2     math1        cc
## math2 1.0000000 0.7443604 0.6570098
## math1 0.7443604 1.0000000 0.5956771
## cc    0.6570098 0.5956771 1.0000000

plot data

# specify square plot region
par(pty="s") 
#pty是指plot type繪圖類型或繪圖區域,"s"或"m"
# scatter plot of math2 by math1
plot(math2 ~ math1, data=dta, xlim=c(0, 60), ylim=c(0, 60),xlab="Math score at Year 1", ylab="Math score at Year 2") 


# add grid lines
grid() #增加輔助線

plot()是用來畫散布圖,表達方式是plot(Y~X),或plot(x=X軸的值,y=Y軸的值)。其他設定:xlim=x軸範圍,ylim=y軸範圍,main=“圖片名稱”,xlab=“X軸名稱”,ylab=“Y軸名稱”

regression analysis

# regress math2 by math1
dta.lm <- lm(math2 ~ math1, data=dta)
# show results
summary(dta.lm)
## 
## Call:
## lm(formula = math2 ~ math1, data = dta)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.430  -5.521  -0.369   4.253  20.388 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   12.944      2.607   4.965 1.57e-05 ***
## math1          1.030      0.152   6.780 5.57e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.255 on 37 degrees of freedom
## Multiple R-squared:  0.5541, Adjusted R-squared:  0.542 
## F-statistic: 45.97 on 1 and 37 DF,  p-value: 5.571e-08

截距項=12.94,斜率為1.03

# show anova table
anova(dta.lm)
## Analysis of Variance Table
## 
## Response: math2
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## math1      1 2419.6 2419.59  45.973 5.571e-08 ***
## Residuals 37 1947.3   52.63                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# 畫迴歸的趨勢線
plot(math2 ~ math1, data=dta, xlim=c(0, 60), ylim=c(0, 60),xlab="Math score at Year 1", ylab="Math score at Year 2")+abline(dta.lm,lty=2)+title("Mathematics Attainment")

## integer(0)
#lty是線的類型(0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash) 
#lwd是線的粗細
#title("Mathematics Attainment")是add plot title

整理:plot()畫散布圖後,可以在畫布上用其他函式增添其他訊息,如points()=畫上點;legend()=作上標記;abline()=畫上線

diagnostics

# specify maximum plot region
par(pty="m")
#
plot(scale(resid(dta.lm)) ~ fitted(dta.lm), 
     ylim=c(-3.5, 3.5), type="n",
     xlab="Fitted values", ylab="Standardized residuals")

#Add Text to a Plot
text(fitted(dta.lm), scale(resid(dta.lm)), labels=rownames(dta), cex=0.5)  

#加上輔助線
grid()

# add a horizontal red dash line
abline(h=0, lty=2, col="red")

normality check

#
qqnorm(scale(resid(dta.lm)))

qqline(scale(resid(dta.lm)))

grid()

Q2

The notation, women{datasets}, indicates that a data object by the name women is in the datasets package. This package is preloaded when R is invoked. Explain the difference between c(women) and c(as.matrix(women)) using the women{datasets}.

women
##    height weight
## 1      58    115
## 2      59    117
## 3      60    120
## 4      61    123
## 5      62    126
## 6      63    129
## 7      64    132
## 8      65    135
## 9      66    139
## 10     67    142
## 11     68    146
## 12     69    150
## 13     70    154
## 14     71    159
## 15     72    164

women資料集裡面有15位女性的身高、體重的數據

str(women)
## 'data.frame':    15 obs. of  2 variables:
##  $ height: num  58 59 60 61 62 63 64 65 66 67 ...
##  $ weight: num  115 117 120 123 126 129 132 135 139 142 ...

women的資料結構(Structure)是data.frame

x<-c(women)
str(x)
## List of 2
##  $ height: num [1:15] 58 59 60 61 62 63 64 65 66 67 ...
##  $ weight: num [1:15] 115 117 120 123 126 129 132 135 139 142 ...

c(women)把data frame變成list

y<-as.matrix(women)

women原為data.frame,透過as.matrix()可轉換為matrix資料結構

str(y)
##  num [1:15, 1:2] 58 59 60 61 62 63 64 65 66 67 ...
##  - attr(*, "dimnames")=List of 2
##   ..$ : NULL
##   ..$ : chr [1:2] "height" "weight"
is.matrix(y)
## [1] TRUE
z<-c(as.matrix(women)) 
is.vector(z)
## [1] TRUE

結論: women的資料結構為data.frame,c(women)的資料結構為list。 as.matrix(women)的資料結構為matrix,c(as.matrix(women))的資料結構為vector。

疑問1:所以c()會讓資料結構”升級”? 疑問2:Matrices和Data frames都有row、column,但兩者究竟有何不同?

Q3

Use help to examine the coding scheme for the mother’s race variable in the birthwt{MASS} dataset.

The MASS comes with the base R installation but is not automatically loaded when R is invoked.

How many black mothers are there in this data frame?

What does the following R command do? > c(“White”, “Black”, “Other”)[birthwt$race]

#用data這個指令,從套件MASS中載入birthwt這個資料集
data(birthwt,package = "MASS")
head(birthwt)
##    low age lwt race smoke ptl ht ui ftv  bwt
## 85   0  19 182    2     0   0  0  1   0 2523
## 86   0  33 155    3     0   0  0  0   3 2551
## 87   0  20 105    1     1   0  0  0   1 2557
## 88   0  21 108    1     1   0  0  1   2 2594
## 89   0  18 107    1     1   0  0  1   0 2600
## 91   0  21 124    3     0   0  0  0   0 2622
str(birthwt)
## 'data.frame':    189 obs. of  10 variables:
##  $ low  : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ age  : int  19 33 20 21 18 21 22 17 29 26 ...
##  $ lwt  : int  182 155 105 108 107 124 118 103 123 113 ...
##  $ race : int  2 3 1 1 1 3 1 3 1 1 ...
##  $ smoke: int  0 0 1 1 1 0 0 0 1 1 ...
##  $ ptl  : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ ht   : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ ui   : int  1 0 0 1 1 0 0 0 0 0 ...
##  $ ftv  : int  0 3 1 2 0 0 1 1 1 0 ...
##  $ bwt  : int  2523 2551 2557 2594 2600 2622 2637 2637 2663 2665 ...
# 從dataframe中取出race這個vector
birthwt$race
##   [1] 2 3 1 1 1 3 1 3 1 1 3 3 3 3 1 1 2 1 3 1 3 1 1 3 3 1 1 1 2 2 2 1 2 1 2 1 1
##  [38] 1 1 1 2 1 2 1 1 1 1 3 1 3 1 3 1 1 3 3 3 3 3 3 3 3 3 1 3 3 3 3 1 2 1 3 3 2
##  [75] 1 2 1 1 2 1 1 1 3 3 3 3 3 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 3 2 1 1 1 2 1
## [112] 3 1 1 1 3 1 3 1 3 1 3 1 1 1 1 1 1 1 1 3 1 2 3 3 3 3 2 3 1 1 1 3 3 1 1 2 1
## [149] 3 3 3 1 1 1 1 3 2 1 2 3 1 3 3 3 2 1 3 3 1 1 2 2 2 3 3 1 1 1 1 2 3 3 1 3 1
## [186] 3 3 2 1

race是數值(num),不知道各自代表甚麼人種。

#
c("White", "Black", "Other")[birthwt$race]
##   [1] "Black" "Other" "White" "White" "White" "Other" "White" "Other" "White"
##  [10] "White" "Other" "Other" "Other" "Other" "White" "White" "Black" "White"
##  [19] "Other" "White" "Other" "White" "White" "Other" "Other" "White" "White"
##  [28] "White" "Black" "Black" "Black" "White" "Black" "White" "Black" "White"
##  [37] "White" "White" "White" "White" "Black" "White" "Black" "White" "White"
##  [46] "White" "White" "Other" "White" "Other" "White" "Other" "White" "White"
##  [55] "Other" "Other" "Other" "Other" "Other" "Other" "Other" "Other" "Other"
##  [64] "White" "Other" "Other" "Other" "Other" "White" "Black" "White" "Other"
##  [73] "Other" "Black" "White" "Black" "White" "White" "Black" "White" "White"
##  [82] "White" "Other" "Other" "Other" "Other" "Other" "White" "White" "White"
##  [91] "White" "Other" "White" "White" "White" "White" "White" "White" "White"
## [100] "White" "White" "White" "Other" "White" "Other" "Black" "White" "White"
## [109] "White" "Black" "White" "Other" "White" "White" "White" "Other" "White"
## [118] "Other" "White" "Other" "White" "Other" "White" "White" "White" "White"
## [127] "White" "White" "White" "White" "Other" "White" "Black" "Other" "Other"
## [136] "Other" "Other" "Black" "Other" "White" "White" "White" "Other" "Other"
## [145] "White" "White" "Black" "White" "Other" "Other" "Other" "White" "White"
## [154] "White" "White" "Other" "Black" "White" "Black" "Other" "White" "Other"
## [163] "Other" "Other" "Black" "White" "Other" "Other" "White" "White" "Black"
## [172] "Black" "Black" "Other" "Other" "White" "White" "White" "White" "Black"
## [181] "Other" "Other" "White" "Other" "White" "Other" "Other" "Black" "White"

c(“White”, “Black”,“Other”)是將”White”編碼為1,“Black”=2,“Other”=3。

#table()函數可知道向量中每個值出現幾次
table(birthwt$race)
## 
##  1  2  3 
## 96 26 67

2=Black,有26個。

Q4

Regarding UCBAdmissions{datasets} data object, what does the output > UCBAdmissions[,1,] > UCBAdmissions[,1,1] > UCBAdmissions[1,1,]

of each of the above R statements mean, respectively?

data(UCBAdmissions,package = "datasets")
UCBAdmissions
## , , Dept = A
## 
##           Gender
## Admit      Male Female
##   Admitted  512     89
##   Rejected  313     19
## 
## , , Dept = B
## 
##           Gender
## Admit      Male Female
##   Admitted  353     17
##   Rejected  207      8
## 
## , , Dept = C
## 
##           Gender
## Admit      Male Female
##   Admitted  120    202
##   Rejected  205    391
## 
## , , Dept = D
## 
##           Gender
## Admit      Male Female
##   Admitted  138    131
##   Rejected  279    244
## 
## , , Dept = E
## 
##           Gender
## Admit      Male Female
##   Admitted   53     94
##   Rejected  138    299
## 
## , , Dept = F
## 
##           Gender
## Admit      Male Female
##   Admitted   22     24
##   Rejected  351    317

看起來很像多重列聯表,呈現在不同科系A~F,“錄取、不錄取”vs”男性、女性”之間的人數。

str(UCBAdmissions)
##  'table' num [1:2, 1:2, 1:6] 512 313 89 19 353 207 17 8 120 205 ...
##  - attr(*, "dimnames")=List of 3
##   ..$ Admit : chr [1:2] "Admitted" "Rejected"
##   ..$ Gender: chr [1:2] "Male" "Female"
##   ..$ Dept  : chr [1:6] "A" "B" "C" "D" ...

UCBAdmissions的資料結構是table,有3個list,依序是Admit、Gender、Dept。

UCBAdmissions[Admit,Gender,Dept]

#各系所錄取之男女生人數
UCBAdmissions[1,,] #1是Admitted、2是Rejected
##         Dept
## Gender     A   B   C   D   E   F
##   Male   512 353 120 138  53  22
##   Female  89  17 202 131  94  24
#各系所男生錄取與不錄取人數
UCBAdmissions[,1,] #1是男性、2是女性
##           Dept
## Admit        A   B   C   D   E   F
##   Admitted 512 353 120 138  53  22
##   Rejected 313 207 205 279 138 351
#Dept = A,男性,錄取與不錄取的人數
UCBAdmissions[,1,1] #[, 1=男性, 1=Dept=A]
## Admitted Rejected 
##      512      313
#各系所男性錄取人數
UCBAdmissions[1,1,]#[1=錄取,1=男性,]
##   A   B   C   D   E   F 
## 512 353 120 138  53  22

Q5

What happens when the following command is entered? > help(ls(“package:MASS”)[92])

Use the observation to find out how many items there are in the package MASS.

#help(ls("package:MASS")[92]) 
#length(ls('package:MASS'))
data(package = "MASS") #會跳出一個視窗列出MASS中所有的datasets,但是不會下載到電腦中

出現錯誤訊息 Error in help(ls(“package:MASS”)[92]) : ‘topic’ should be a name, length-one character vector or reserved word。

ls(data(package = "MASS"))
## [1] "footer"  "header"  "results" "title"
data(package = "MASS")$result #發現這樣可以列出package中所有的datasets的Package LibPath、Item、Title
##       Package LibPath                              Item       
##  [1,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Aids2"    
##  [2,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Animals"  
##  [3,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Boston"   
##  [4,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Cars93"   
##  [5,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Cushings" 
##  [6,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "DDT"      
##  [7,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "GAGurine" 
##  [8,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Insurance"
##  [9,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Melanoma" 
## [10,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "OME"      
## [11,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Pima.te"  
## [12,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Pima.tr"  
## [13,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Pima.tr2" 
## [14,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Rabbit"   
## [15,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Rubber"   
## [16,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "SP500"    
## [17,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Sitka"    
## [18,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Sitka89"  
## [19,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Skye"     
## [20,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "Traffic"  
## [21,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "UScereal" 
## [22,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "UScrime"  
## [23,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "VA"       
## [24,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "abbey"    
## [25,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "accdeaths"
## [26,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "anorexia" 
## [27,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "bacteria" 
## [28,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "beav1"    
## [29,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "beav2"    
## [30,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "biopsy"   
## [31,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "birthwt"  
## [32,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "cabbages" 
## [33,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "caith"    
## [34,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "cats"     
## [35,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "cement"   
## [36,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "chem"     
## [37,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "coop"     
## [38,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "cpus"     
## [39,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "crabs"    
## [40,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "deaths"   
## [41,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "drivers"  
## [42,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "eagles"   
## [43,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "epil"     
## [44,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "farms"    
## [45,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "fgl"      
## [46,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "forbes"   
## [47,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "galaxies" 
## [48,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "gehan"    
## [49,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "genotype" 
## [50,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "geyser"   
## [51,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "gilgais"  
## [52,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "hills"    
## [53,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "housing"  
## [54,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "immer"    
## [55,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "leuk"     
## [56,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "mammals"  
## [57,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "mcycle"   
## [58,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "menarche" 
## [59,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "michelson"
## [60,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "minn38"   
## [61,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "motors"   
## [62,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "muscle"   
## [63,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "newcomb"  
## [64,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "nlschools"
## [65,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "npk"      
## [66,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "npr1"     
## [67,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "oats"     
## [68,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "painters" 
## [69,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "petrol"   
## [70,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "phones"   
## [71,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "quine"    
## [72,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "road"     
## [73,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "rotifer"  
## [74,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "ships"    
## [75,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "shoes"    
## [76,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "shrimp"   
## [77,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "shuttle"  
## [78,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "snails"   
## [79,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "steam"    
## [80,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "stormer"  
## [81,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "survey"   
## [82,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "synth.te" 
## [83,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "synth.tr" 
## [84,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "topo"     
## [85,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "waders"   
## [86,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "whiteside"
## [87,] "MASS"  "C:/Program Files/R/R-4.1.1/library" "wtloss"   
##       Title                                                           
##  [1,] "Australian AIDS Survival Data"                                 
##  [2,] "Brain and Body Weights for 28 Species"                         
##  [3,] "Housing Values in Suburbs of Boston"                           
##  [4,] "Data from 93 Cars on Sale in the USA in 1993"                  
##  [5,] "Diagnostic Tests on Patients with Cushing's Syndrome"          
##  [6,] "DDT in Kale"                                                   
##  [7,] "Level of GAG in Urine of Children"                             
##  [8,] "Numbers of Car Insurance claims"                               
##  [9,] "Survival from Malignant Melanoma"                              
## [10,] "Tests of Auditory Perception in Children with OME"             
## [11,] "Diabetes in Pima Indian Women"                                 
## [12,] "Diabetes in Pima Indian Women"                                 
## [13,] "Diabetes in Pima Indian Women"                                 
## [14,] "Blood Pressure in Rabbits"                                     
## [15,] "Accelerated Testing of Tyre Rubber"                            
## [16,] "Returns of the Standard and Poors 500"                         
## [17,] "Growth Curves for Sitka Spruce Trees in 1988"                  
## [18,] "Growth Curves for Sitka Spruce Trees in 1989"                  
## [19,] "AFM Compositions of Aphyric Skye Lavas"                        
## [20,] "Effect of Swedish Speed Limits on Accidents"                   
## [21,] "Nutritional and Marketing Information on US Cereals"           
## [22,] "The Effect of Punishment Regimes on Crime Rates"               
## [23,] "Veteran's Administration Lung Cancer Trial"                    
## [24,] "Determinations of Nickel Content"                              
## [25,] "Accidental Deaths in the US 1973-1978"                         
## [26,] "Anorexia Data on Weight Change"                                
## [27,] "Presence of Bacteria after Drug Treatments"                    
## [28,] "Body Temperature Series of Beaver 1"                           
## [29,] "Body Temperature Series of Beaver 2"                           
## [30,] "Biopsy Data on Breast Cancer Patients"                         
## [31,] "Risk Factors Associated with Low Infant Birth Weight"          
## [32,] "Data from a cabbage field trial"                               
## [33,] "Colours of Eyes and Hair of People in Caithness"               
## [34,] "Anatomical Data from Domestic Cats"                            
## [35,] "Heat Evolved by Setting Cements"                               
## [36,] "Copper in Wholemeal Flour"                                     
## [37,] "Co-operative Trial in Analytical Chemistry"                    
## [38,] "Performance of Computer CPUs"                                  
## [39,] "Morphological Measurements on Leptograpsus Crabs"              
## [40,] "Monthly Deaths from Lung Diseases in the UK"                   
## [41,] "Deaths of Car Drivers in Great Britain 1969-84"                
## [42,] "Foraging Ecology of Bald Eagles"                               
## [43,] "Seizure Counts for Epileptics"                                 
## [44,] "Ecological Factors in Farm Management"                         
## [45,] "Measurements of Forensic Glass Fragments"                      
## [46,] "Forbes' Data on Boiling Points in the Alps"                    
## [47,] "Velocities for 82 Galaxies"                                    
## [48,] "Remission Times of Leukaemia Patients"                         
## [49,] "Rat Genotype Data"                                             
## [50,] "Old Faithful Geyser Data"                                      
## [51,] "Line Transect of Soil in Gilgai Territory"                     
## [52,] "Record Times in Scottish Hill Races"                           
## [53,] "Frequency Table from a Copenhagen Housing Conditions Survey"   
## [54,] "Yields from a Barley Field Trial"                              
## [55,] "Survival Times and White Blood Counts for Leukaemia Patients"  
## [56,] "Brain and Body Weights for 62 Species of Land Mammals"         
## [57,] "Data from a Simulated Motorcycle Accident"                     
## [58,] "Age of Menarche in Warsaw"                                     
## [59,] "Michelson's Speed of Light Data"                               
## [60,] "Minnesota High School Graduates of 1938"                       
## [61,] "Accelerated Life Testing of Motorettes"                        
## [62,] "Effect of Calcium Chloride on Muscle Contraction in Rat Hearts"
## [63,] "Newcomb's Measurements of the Passage Time of Light"           
## [64,] "Eighth-Grade Pupils in the Netherlands"                        
## [65,] "Classical N, P, K Factorial Experiment"                        
## [66,] "US Naval Petroleum Reserve No. 1 data"                         
## [67,] "Data from an Oats Field Trial"                                 
## [68,] "The Painter's Data of de Piles"                                
## [69,] "N. L. Prater's Petrol Refinery Data"                           
## [70,] "Belgium Phone Calls 1950-1973"                                 
## [71,] "Absenteeism from School in Rural New South Wales"              
## [72,] "Road Accident Deaths in US States"                             
## [73,] "Numbers of Rotifers by Fluid Density"                          
## [74,] "Ships Damage Data"                                             
## [75,] "Shoe wear data of Box, Hunter and Hunter"                      
## [76,] "Percentage of Shrimp in Shrimp Cocktail"                       
## [77,] "Space Shuttle Autolander Problem"                              
## [78,] "Snail Mortality Data"                                          
## [79,] "The Saturated Steam Pressure Data"                             
## [80,] "The Stormer Viscometer Data"                                   
## [81,] "Student Survey Data"                                           
## [82,] "Synthetic Classification Problem"                              
## [83,] "Synthetic Classification Problem"                              
## [84,] "Spatial Topographic Data"                                      
## [85,] "Counts of Waders at 15 Sites in South Africa"                  
## [86,] "House Insulation: Whiteside's Data"                            
## [87,] "Weight Loss Data from an Obese Patient"

所以package”MASS”中總計有87個items。