ICA 2: R Output Analysis
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
ICA 2: R Output Analysis
ITAO 20200: Statistical Inference in Business
dietstudy <- read .csv ("dietstudy .csv")
library(psych)
describe(dietstudy[, c ("Triglyceride" , "Final_Triglyceride" , "Weight" , "Final_Weight")], fast = TRUE)
## |
vars n mean sd min max range se |
## Triglyceride |
1 16 138 .44 29 .04 94 186 92 7 .26 |
## Final_Triglyceride |
2 16 124 .38 29 .41 82 174 92 7 .35 |
## Weight |
3 16 198 .38 33 .47 151 257 106 8 .37 |
## Final_Weight |
4 16 190 .31 33 .51 140 249 109 8 .38 |
t .test(dietstudy$Triglyceride, alternative = "two .sided" , mu = 140 , conf .level = 0.95)
##
## One Sample t-test
##
## data: dietstudy$Triglyceride
## t = -0 .21522, df = 15, p-value = 0 .8325
## alternative hypothesis: true mean is not equal to 140
## 95 percent confidence interval:
## 122 .9631 153 .9119
## sample estimates:
## mean of x
## 138 .4375
t .test(dietstudy$Weight, alternative = "two .sided" , mu = 205 , conf .level = 0.95)
##
## One Sample t-test
##
## data: dietstudy$Weight
## t = -0 .7917, df = 15, p-value = 0 .4409
## alternative hypothesis: true mean is not equal to 205
## 95 percent confidence interval:
## 180 .539 216 .211
## sample estimates:
## mean of x
## 198 .375
t .test(dietstudy$Triglyceride, dietstudy$Final_Triglyceride,
alternative = "two .sided" , mu = 0 , conf .level = 0.95 , paired = TRUE)
##
## Paired t-test
##
## data: dietstudy$Triglyceride and dietstudy$Final_Triglyceride
## t = 1 .2, df = 15, p-value = 0 .2487
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -10 .91541 39 .04041
## sample estimates:
## mean of the differences
## 14 .0625
t .test(dietstudy$Weight, dietstudy$Final_Weight,
alternative = "two .sided" , mu = 0 , conf .level = 0.95 , paired = TRUE)
##
## Paired t-test
##
## data: dietstudy$Weight and dietstudy$Final_Weight
## t = 11 .175, df = 15, p-value = 1 .138e-08
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 6 .524643 9 .600357
## sample estimates:
## mean of the differences
## 8 .0625
2023-03-07
ITAO 20200: Statistical Inference in Business