Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- H_0:σ_men^2=σ_women^2
- H_1: σ_men^2>σ_women^2
- Assuming both the men and the women follow a normal distribution we can say that the test statistic f is:
- f=(s_men^2)/(s_(women )^2 )=0.8362
- n_men=25
- n_women=21
- f_c=2.859
- Since f is less than f_c we can say that we cannot reject the null hypothesis and we cannot accept the alternative.
- Using MATLAB, we compute the ANOVA for the data
- brick =
- 21.8000 21.7000 21.9000 21.9000
- 21.9000 21.4000 21.8000 21.7000
- 21.7000 21.5000 21.8000 21.8000
- 21.6000 21.5000 21.6000 21.7000
- 21.7000 NaN 21.5000 21.6000
- 21.5000 NaN NaN 21.8000
- 21.8000 NaN NaN NaN
- >> anova1(brick)
- ans =
- 0.0827
- Source SS df MS F Prob>F
- Groups 0.13911 3 0.04637 2.62 0.0827
- Error 0.31907 18 0.01773
- Total 0.45818 21
- 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.
- H_0:σ_before^2-σ_after^2=3
- H_1:σ_before^2-σ_after^2>3
- > 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)
- > turbidity=c(125,118,103,105,26,90,99,100,105,55,267,286,235,265)
- > plot(temp,turbidity)
- > fit <- lm(turbidity~temp)
- > fit
- Call:
- lm(formula = turbidity ~ temp)
- Coefficients:
- (Intercept) temp
- -510.71 26.31
- > fit$residuals
- 1 2 3 4 5 6
- 33.252837 -2.686318 11.252837 10.622005 -2.607188 -88.564628
- 7 8 9 10 11 12
- -69.041299 -75.933796 -91.980454 -34.116330 67.388714 110.066204
- 13 14
- 56.435372 75.912043
- c and d.
- > summary(fit)
- Call:
- lm(formula = turbidity ~ temp)
- Residuals:
- Min 1Q Median 3Q Max
- -91.980 -60.310 4.007 50.640 110.066
- Coefficients:
- Estimate Std. Error t value Pr(>|t|)
- (Intercept) -510.713 228.196 -2.238 0.0450 *
- temp 26.308 9.178 2.867 0.0142 *
- ---
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- Residual standard error: 67.68 on 12 degrees of freedom
- Multiple R-squared: 0.4064, Adjusted R-squared: 0.357
- F-statistic: 8.217 on 1 and 12 DF, p-value: 0.01418
- Multiple R-squared: 0.4064, Adjusted R-squared: 0.357
- 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.
- Linear regression seems like it will work pretty well here since it looks like we have a line.
- R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
- Copyright (C) 2014 The R Foundation for Statistical Computing
- Platform: x86_64-w64-mingw32/x64 (64-bit)
- R is free software and comes with ABSOLUTELY NO WARRANTY.
- You are welcome to redistribute it under certain conditions.
- Type 'license()' or 'licence()' for distribution details.
- R is a collaborative project with many contributors.
- Type 'contributors()' for more information and
- 'citation()' on how to cite R or R packages in publications.
- Type 'demo()' for some demos, 'help()' for on-line help, or
- 'help.start()' for an HTML browser interface to help.
- Type 'q()' to quit R.
- [Workspace loaded from ~/.RData]
- > blood = c(1,0,1,2,5,1,4,6,2,3,5,4,6,8,4,5,7,9,7,6)
- > sound = c(60,63,65,70,70,70,80,90,80,80,85,89,90,90,90,90,94,100,100,100)
- > plot(blood,sound)
- Error in plot.new() : figure margins too large
- > plot(sound,blood)
- > plot(blood,sound)
- > fit <- lm(blood~sound)
- > fit
- Call:
- lm(formula = blood ~ sound)
- Coefficients:
- (Intercept) sound
- -10.1315 0.1743
- > summary(fit)
- Call:
- lm(formula = blood ~ sound)
- Residuals:
- Min 1Q Median 3Q Max
- -1.8120 -0.9040 -0.1333 0.5023 2.9310
- Coefficients:
- Estimate Std. Error t value Pr(>|t|)
- (Intercept) -10.13154 1.99490 -5.079 7.83e-05 ***
- sound 0.17429 0.02383 7.314 8.57e-07 ***
- ---
- Signif. codes:
- 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- Residual standard error: 1.318 on 18 degrees of freedom
- Multiple R-squared: 0.7483, Adjusted R-squared: 0.7343
- F-statistic: 53.5 on 1 and 18 DF, p-value: 8.567e-07
- > 85* 0.17429 -10.13154
- [1] 4.68311
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement