Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

does anyone know how to enter this into rstudio? i need to produce the summary f

ID: 3216978 • Letter: D

Question

does anyone know how to enter this into rstudio? i need to produce the summary for anova and i cant seem to get it right please help! Complete the classical six-step hypothesis testing method. using the lab demo as an example, to determine if the group means are equal at the =0.05 significance level. (FYI: Location 1 = South Salt Lake; Location 2 = Salt Lake City; Location 3 = Murray; Location 4 = Park City). use r studio and show F statistics table and summary

HomePrice

Location

174

1

150

1

140

1

155

1

182

1

151

1

148

1

145

1

130

2

186

2

167

2

156

2

172

2

190

2

168

2

165

2

132

3

145

3

139

3

135

3

124

3

152

3

179

3

147

3

175

4

201

4

191

4

194

4

210

4

200

4

220

4

199

4

HomePrice

Location

174

1

150

1

140

1

155

1

182

1

151

1

148

1

145

1

130

2

186

2

167

2

156

2

172

2

190

2

168

2

165

2

132

3

145

3

139

3

135

3

124

3

152

3

179

3

147

3

175

4

201

4

191

4

194

4

210

4

200

4

220

4

199

4

Explanation / Answer

First copy second column from excel consisting of numarical values and then use the following command,

> Loc =scan("clipboard")
Read 32 items
> Loc
[1] 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4

Then copy first column from excel consisting of numarical values and then use the following command,

> HP = scan("clipboard")

Read 32 items
> HP
[1] 174 150 140 155 182 151 148 145 130 186 167 156 172 190 168 165 132 145 139
[20] 135 124 152 179 147 175 201 191 194 210 200 220 199
> d =cbind(HP,Loc)
> d
HP Loc
[1,] 174 1
[2,] 150 1
[3,] 140 1
[4,] 155 1
[5,] 182 1
[6,] 151 1
[7,] 148 1
[8,] 145 1
[9,] 130 2
[10,] 186 2
[11,] 167 2
[12,] 156 2
[13,] 172 2
[14,] 190 2
[15,] 168 2
[16,] 165 2
[17,] 132 3
[18,] 145 3
[19,] 139 3
[20,] 135 3
[21,] 124 3
[22,] 152 3
[23,] 179 3
[24,] 147 3
[25,] 175 4
[26,] 201 4
[27,] 191 4
[28,] 194 4
[29,] 210 4
[30,] 200 4
[31,] 220 4
[32,] 199 4
> d=data.frame(d)
> d1=subset(d,Loc=="1")
> d1
HP Loc
1 174 1
2 150 1
3 140 1
4 155 1
5 182 1
6 151 1
7 148 1
8 145 1
> d2=subset(d,Loc=="2")
> d2
HP Loc
9 130 2
10 186 2
11 167 2
12 156 2
13 172 2
14 190 2
15 168 2
16 165 2
> d3=subset(d,Loc=="3")
> d3
HP Loc
17 132 3
18 145 3
19 139 3
20 135 3
21 124 3
22 152 3
23 179 3
24 147 3
> d4=subset(d,Loc=="4")
> d4
HP Loc
25 175 4
26 201 4
27 191 4
28 194 4
29 210 4
30 200 4
31 220 4
32 199 4
> D=data.frame(d1,d2,d3,d4)
> D
HP Loc HP.1 Loc.1 HP.2 Loc.2 HP.3 Loc.3
1 174 1 130 2 132 3 175 4
2 150 1 186 2 145 3 201 4
3 140 1 167 2 139 3 191 4
4 155 1 156 2 135 3 194 4
5 182 1 172 2 124 3 210 4
6 151 1 190 2 152 3 200 4
7 148 1 168 2 179 3 220 4
8 145 1 165 2 147 3 199 4
> A=aov(HP ~Loc,data=D)
> A
Call:
aov(formula = HP ~ Loc, data = D)

Terms:
Residuals
Sum of Squares 1501.875
Deg. of Freedom 7

Residual standard error: 14.64765
> summary(A)
Df Sum Sq Mean Sq F value Pr(>F)
Residuals 7 1502 214.6   
>