In: Math
What is the relationship between the number of minutes per day a woman spends talking on the phone and the woman's weight? The time on the phone and weight for 8 women are shown in the table below.
Time | 29 | 12 | 64 | 90 | 59 | 36 | 53 | 65 |
---|---|---|---|---|---|---|---|---|
Pounds | 99 | 113 | 131 | 148 | 113 | 125 | 115 | 127 |
Solution:
Use cor.test function in R to get the correlation coefficient and p value for the hypothesis test for correlation
Time <- c(29 ,12
,64, 90, 59, 36,
53, 65)
Pounds <- c(99, 113 ,131,
148 ,113, 125 ,115,
127)
cor.test(Time,Pounds)
Output:
Pearson's product-moment correlation
data: Time and Pounds
t = 2.8837, df = 6, p-value = 0.02792
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.1241646 0.9543008
sample estimates:
cor
0.7621527
Solution-A:
the correlation coefficient: r=0.76
The p-value is: (Round to four decimal places)
p= 0.0279
For this linear regression use lm function in R
linmod <- lm(Pounds~Time)
coefficients(linmod)
summary(linmod)
Output:
coefficients(linmod)
(Intercept) Time
97.8862333 0.4605641
> summary(linmod)
Call:
lm(formula = Pounds ~ Time)
Residuals:
Min 1Q Median 3Q Max
-12.243 -8.487 1.407 8.894 10.534
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 97.8862 8.9269 10.965 3.42e-05 ***
Time 0.4606 0.1597 2.884 0.0279 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 10.33 on 6 degrees of freedom
Multiple R-squared: 0.5809, Adjusted R-squared:
0.511
F-statistic: 8.316 on 1 and 6 DF, p-value: 0.02792
r^2=0.58
y^=97.89+0.46*x
For x=46 ,y^=97.89+0.46*46=119.05=119
t the weight of a woman who spends 46 minutes on the phone=119