Dateianhang 'session7rhexerc.r'
Herunterladen 1 ## For the Cars93 (MASS) data set, answer the following:
2 ## For MPG.highway modeled by Horsepower, find the simple regression
3 ## coefficients. What is the predicted mileage for a car with 225 horsepower?
4
5 require(MASS)
6
7
8
9
10
11
12
13
14 ## Fit the linear model with MPG.highway modeled by Weight.
15 ## Find the predicted highway mileage of a 6,400 pound HUMMER H2 and
16 ## a 2,524 pound MINI Cooper.
17
18
19
20
21
22
23
24
25
26
27 ## Fit the linear model Max.Price modeled by Min.Price.
28 ## Why might you expect the slope to be around 1 ?
29
30
31
32
33
34
35 ## For the data set MLBattend (UsingR) concerning major league baseball
36 ## attendance, fit a linear model of attendance modeled by wins.
37 ## What is the predicted increase in attendance if a team that won 80
38 ## games last year wins 90 this year?
39
40
41
42
43
44
45
46
47
48 ## People often predict children’s future height by using their
49 ## 2-year-old height. A common rule is to double the height.
50 ## Table 10.2 contains data for eight people’s heights as 2-year-olds
51 ## and as adults. Using the data, what is the predicted adult height
52 ## for a 2-year-old who is 33 inches tall?
53
54 data <- data.frame(age2 = c(39,30,32,34,35,36,36,30),
55 adult = c(71,63,63,67,68,68,70,64))
56
57
58
59
60
61
62
63
64
65 ## With the \texttt{rmr} (ISwR) data set, plot metabolic rate versus
66 ## body weight. Fit a linear regression model to the relation. According
67 ## to the fitted model, what is the predicted metabolic rate for a body
68 ## weight of 70 kg? Give a 95\% confidence interval for the slope of the line.
69
70 require(ISwR)
71
72
73
74 ## In the juul (ISwR) data set, fit a linear regression
75 ## model for the square root of the IGF-I concentration versus age
76 ## to the group of subjects over 25 years old.
77 ## look at the use of the subset argument in this tutorial:
78 ## http://ww2.coastal.edu/kingw/statistics/R-tutorials/simplelinear.html
79
80
81
82
83
84 ## In the malaria data set, analyze the log-transformed antibody level
85 ## versus age. Make a plot of the relation. Do you notice anything peculiar?
86
Gespeicherte Dateianhänge
Um Dateianhänge in eine Seite einzufügen sollte unbedingt eine Angabe wie attachment:dateiname benutzt werden, wie sie auch in der folgenden Liste der Dateien erscheint. Es sollte niemals die URL des Verweises ("laden") kopiert werden, da sich diese jederzeit ändern kann und damit der Verweis auf die Datei brechen würde.Sie dürfen keine Anhänge an diese Seite anhängen!