Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1.  
  2. H_0:σ_men^2=σ_women^2
  3. H_1: σ_men^2>σ_women^2
  4. Assuming both the men and the women follow a normal distribution we can say that the test statistic f is:
  5. f=(s_men^2)/(s_(women )^2 )=0.8362
  6. n_men=25
  7. n_women=21
  8. f_c=2.859
  9.  
  10. Since f is less than f_c we can say that we cannot reject the null hypothesis and we cannot accept the alternative.
  11.  
  12.  
  13. Using MATLAB, we compute the ANOVA for the data
  14. brick =
  15.  
  16. 21.8000 21.7000 21.9000 21.9000
  17. 21.9000 21.4000 21.8000 21.7000
  18. 21.7000 21.5000 21.8000 21.8000
  19. 21.6000 21.5000 21.6000 21.7000
  20. 21.7000 NaN 21.5000 21.6000
  21. 21.5000 NaN NaN 21.8000
  22. 21.8000 NaN NaN NaN
  23.  
  24. >> anova1(brick)
  25.  
  26. ans =
  27.  
  28. 0.0827
  29.  
  30.  
  31.  
  32. Source SS df MS F Prob>F
  33. Groups 0.13911 3 0.04637 2.62 0.0827
  34. Error 0.31907 18 0.01773
  35. Total 0.45818 21
  36.  
  37. As we can see, the f value is 2.62, which is smaller than our critical f value of 3.16 therefore we cannot reject the null hypothesis so we can’t show that the firing temperature affects the density of the brick.
  38.  
  39.  
  40. H_0:σ_before^2-σ_after^2=3
  41. H_1:σ_before^2-σ_after^2>3
  42.  
  43.  
  44.  
  45.  
  46. > temp = c(22.9,24.0,22.9,23.0,20.5,26.2,25.8,26.1,26.9,22.8,27.0,26.1,26.2,26.6)
  47. > turbidity=c(125,118,103,105,26,90,99,100,105,55,267,286,235,265)
  48. > plot(temp,turbidity)
  49. > fit <- lm(turbidity~temp)
  50. > fit
  51.  
  52. Call:
  53. lm(formula = turbidity ~ temp)
  54.  
  55. Coefficients:
  56. (Intercept) temp
  57. -510.71 26.31
  58.  
  59.  
  60.  
  61. > fit$residuals
  62. 1 2 3 4 5 6
  63. 33.252837 -2.686318 11.252837 10.622005 -2.607188 -88.564628
  64. 7 8 9 10 11 12
  65. -69.041299 -75.933796 -91.980454 -34.116330 67.388714 110.066204
  66. 13 14
  67. 56.435372 75.912043
  68.  
  69. c and d.
  70. > summary(fit)
  71.  
  72. Call:
  73. lm(formula = turbidity ~ temp)
  74.  
  75. Residuals:
  76. Min 1Q Median 3Q Max
  77. -91.980 -60.310 4.007 50.640 110.066
  78.  
  79. Coefficients:
  80. Estimate Std. Error t value Pr(>|t|)
  81. (Intercept) -510.713 228.196 -2.238 0.0450 *
  82. temp 26.308 9.178 2.867 0.0142 *
  83. ---
  84. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  85.  
  86. Residual standard error: 67.68 on 12 degrees of freedom
  87. Multiple R-squared: 0.4064, Adjusted R-squared: 0.357
  88. F-statistic: 8.217 on 1 and 12 DF, p-value: 0.01418
  89.  
  90.  
  91. Multiple R-squared: 0.4064, Adjusted R-squared: 0.357
  92.  
  93.  
  94. Both the slope and the intercept have p-values from the t-test that are smaller than 0.05, therefore it is likely that they are a good fit for the data we have.
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104. Linear regression seems like it will work pretty well here since it looks like we have a line.
  105.  
  106.  
  107.  
  108.  
  109. R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
  110. Copyright (C) 2014 The R Foundation for Statistical Computing
  111. Platform: x86_64-w64-mingw32/x64 (64-bit)
  112.  
  113. R is free software and comes with ABSOLUTELY NO WARRANTY.
  114. You are welcome to redistribute it under certain conditions.
  115. Type 'license()' or 'licence()' for distribution details.
  116.  
  117. R is a collaborative project with many contributors.
  118. Type 'contributors()' for more information and
  119. 'citation()' on how to cite R or R packages in publications.
  120.  
  121. Type 'demo()' for some demos, 'help()' for on-line help, or
  122. 'help.start()' for an HTML browser interface to help.
  123. Type 'q()' to quit R.
  124.  
  125. [Workspace loaded from ~/.RData]
  126.  
  127. > blood = c(1,0,1,2,5,1,4,6,2,3,5,4,6,8,4,5,7,9,7,6)
  128. > sound = c(60,63,65,70,70,70,80,90,80,80,85,89,90,90,90,90,94,100,100,100)
  129. > plot(blood,sound)
  130. Error in plot.new() : figure margins too large
  131. > plot(sound,blood)
  132. > plot(blood,sound)
  133. > fit <- lm(blood~sound)
  134. > fit
  135.  
  136. Call:
  137. lm(formula = blood ~ sound)
  138.  
  139. Coefficients:
  140. (Intercept) sound
  141. -10.1315 0.1743
  142.  
  143. > summary(fit)
  144.  
  145. Call:
  146. lm(formula = blood ~ sound)
  147.  
  148. Residuals:
  149. Min 1Q Median 3Q Max
  150. -1.8120 -0.9040 -0.1333 0.5023 2.9310
  151.  
  152. Coefficients:
  153. Estimate Std. Error t value Pr(>|t|)
  154. (Intercept) -10.13154 1.99490 -5.079 7.83e-05 ***
  155. sound 0.17429 0.02383 7.314 8.57e-07 ***
  156. ---
  157. Signif. codes:
  158. 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  159.  
  160. Residual standard error: 1.318 on 18 degrees of freedom
  161. Multiple R-squared: 0.7483, Adjusted R-squared: 0.7343
  162. F-statistic: 53.5 on 1 and 18 DF, p-value: 8.567e-07
  163.  
  164. > 85* 0.17429 -10.13154
  165. [1] 4.68311
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement