\(H_0\): ; \(H_A\):
testpc= c(38, 54, 63, 45, 40, 49, 58, 57,
55, 84, 79, 65, 78, 74, 58, 69)
testpcs = c(rep("1.Project",8), rep("2.Concept",8))
t.test(testpc~testpcs, conf.level=1-0.05,
mu=0, alternative = "two.sided",var.equal=FALSE)
##
## Welch Two Sample t-test
##
## data: testpc by testpcs
## t = -4.0718, df = 13.728, p-value = 0.001188
## alternative hypothesis: true difference in means between group 1.Project and group 2.Concept is not equal to 0
## 95 percent confidence interval:
## -30.172544 -9.327456
## sample estimates:
## mean in group 1.Project mean in group 2.Concept
## 50.50 70.25
Welch Two sample T-test and CI Equal variance p value < . Hence reject
\(H_0\): \(H_A\):
median(testpc)
## [1] 58
median.
| Student 1 | Student 2 | Student 3 | Student 4 | Student 5 | Student 6 | Student 7 | Student 8 | |
|---|---|---|---|---|---|---|---|---|
| Project-based | 38 | 54 | 63 | 45 | 40 | 49 | 58 | 57 |
| Concept-based | 55 | 84 | 79 | 65 | 78 | 74 | 58 | 69 |
\(H_0\): \(H_A\):
testpc= c(38, 54, 63, 45, 40, 49, 58, 57,
55, 84, 79, 65, 78, 74, 58, 69)
testpcs = c(rep("1.Project",8), rep("2.Concept",8))
t.test(testpc~testpcs, conf.level=1-0.05,
mu=0, alternative = "two.sided",var.equal=FALSE)
##
## Welch Two Sample t-test
##
## data: testpc by testpcs
## t = -4.0718, df = 13.728, p-value = 0.001188
## alternative hypothesis: true difference in means between group 1.Project and group 2.Concept is not equal to 0
## 95 percent confidence interval:
## -30.172544 -9.327456
## sample estimates:
## mean in group 1.Project mean in group 2.Concept
## 50.50 70.25
Welch two sample test
#Your code here
\(H_0\): \(H_A\):
Project = c(38, 54, 63, 45, 40, 49, 58, 57)
Concept =c(55, 84, 79, 65, 78, 74, 58, 69)
median(Project)
## [1] 51.5
median(Concept)
## [1] 71.5
Under the nonparametric method, the median population score for “Project” is smaller than “Concept.”
diabetes_data = read.csv(url("https://hbiostat.org/data/repo/diabetes.csv"))
\(H_0\): \(H_A\):
# Hint: For the positive and negative count of the test, use:
diabetes_data = read.csv(url("https://hbiostat.org/data/repo/diabetes.csv"))
hypothised_median = 40.5
Ages = diabetes_data$age
positives_count = sum( Ages > 40.5)
negatives_count = sum( Ages < 40.5)
binom.test(positives_count, positives_count + negatives_count,
alternative = "two.sided", conf.level = 1-0.10)
##
## Exact binomial test
##
## data: positives_count and positives_count + negatives_count
## number of successes = 243, number of trials = 403, p-value = 4.164e-05
## alternative hypothesis: true probability of success is not equal to 0.5
## 90 percent confidence interval:
## 0.5611779 0.6436461
## sample estimates:
## probability of success
## 0.6029777
Exact binomial test.
\(H_0\): \(H_A\):.
diabetes_data = read.csv(url("https://hbiostat.org/data/repo/diabetes.csv"))
stabgluc= diabetes_data$stab.glu
genders= diabetes_data$gender
t.test(stabgluc ~ genders, mu=0, alternative = "two.sided", conf.level = 0.90)
##
## Welch Two Sample t-test
##
## data: stabgluc by genders
## t = -1.6937, df = 278.38, p-value = 0.09145
## alternative hypothesis: true difference in means between group female and group male is not equal to 0
## 90 percent confidence interval:
## -18.940720 -0.245342
## sample estimates:
## mean in group female mean in group male
## 102.6496 112.2426
Two sample T test
https://hbiostat.org/data, courtesy of the Vanderbilt University Department of Biostatistics↩︎