Question

In: Statistics and Probability

# 2: T test for two means The data in SteelStrengthData.txt consists ofn1= 32 strength measurements...

# 2: T test for two means

The data in SteelStrengthData.txt consists ofn1= 32 strength measurements of cold-rolled steel andn2= 35 measurements of two-sided galvanized steel. Import it into the data framedf2 and complete the following parts.

Use boxplot(Value∼Sample, notch=TRUE, data=df2) to do a comparative box plot. Do the two medians appear significantly different? (NOTE:∼does not copy-paste well.)

Test the hypothesisH0:μ1−μ2= 0 vs Ha:μ1−μ26= 0, at level of significance 0.1, without assuming σ1=σ2. Report the outcome of the test and also the 90% CI for μ1−μ2.3. Repeat the above using the assumption that σ1=σ2.

Using R please

Solutions

Expert Solution

I have answered the question below

Please up vote for the same and thanks!!!

Do reach out in the comments for any queries

Answer:

The R snippet is as follows


df=read.table("http://personal.psu.edu/acq/401/Data/SteelStrengthData.txt", header = T)
boxplot(Value∼Sample, notch=TRUE, data=df)


# we can perform the t test as shoen below

sample1 <- subset(df,df$Sample==1)
sample2 <- subset(df,df$Sample==2)

## variance true
t.test(sample1$Value,sample2$Value,alternative = "two.sided",conf.level = 0.90,var.equal = TRUE)


## variance false
t.test(sample1$Value,sample2$Value,alternative = "two.sided",conf.level = 0.90,var.equal = FALSE)

The results are

> t.test(sample1$Value,sample2$Value,alternative = "two.sided",conf.level = 0.90,var.equal = TRUE)

   Two Sample t-test

data: sample1$Value and sample2$Value
t = -3.5756, df = 65, p-value = 0.0006655 ## significant result , as the p value is less than 0.05
alternative hypothesis: true difference in means is not equal to 0
90 percent confidence interval:
-7.186881 -2.613352

sample estimates:
mean of x mean of y
29.79531 34.69543

> ## variance false
> t.test(sample1$Value,sample2$Value,alternative = "two.sided",conf.level = 0.90,var.equal = FALSE)

   Welch Two Sample t-test

data: sample1$Value and sample2$Value
t = -3.6543, df = 56.108, p-value = 0.000569 ## significant result , as the p value is less than 0.05
alternative hypothesis: true difference in means is not equal to 0
90 percent confidence interval:
-7.142758 -2.657474

sample estimates:
mean of x mean of y
29.79531 34.69543


Related Solutions

In which of the following scenarios will conducting a two-sample t t -test for means be...
In which of the following scenarios will conducting a two-sample t t -test for means be appropriate? CHECK ALL THAT APPLY. A. To test if there is a difference between the mean annual income of husbands and that of wives in Canada. B. To test if the mean annual income of Ontarians is higher than that of British Columbians. C. To test if there is a difference between the mean annual income of male British Columbians and that of female...
Find the requested confidence interval. The data below consists of the test scores of 32 students....
Find the requested confidence interval. The data below consists of the test scores of 32 students. Construct a 95.44% confidence interval for the population mean. 88 70 67 95 99 72 86 60 57 92 90 88 70 73 88 97 109 63 76 71 97 88 70 79 54 80 83 92 91 66 90 90
5. TWO (INDEPENDENT) SAMPLE T-TEST (a) Describe the independent samples t-test for two means briefly. How...
5. TWO (INDEPENDENT) SAMPLE T-TEST (a) Describe the independent samples t-test for two means briefly. How does it do it? (b) State the null and the alternative hypothesis. (c) State the assumptions. (d) State the formula for the test statistic. (e) State the rejection rule with (How to reject the null hypothesis) (f) Give an real life example of how we can use the independent samples t-test for two means.
TWO (INDEPENDENT) SAMPLE T-TEST (a)Describe the independent samples t-test for two means briefly. How does it...
TWO (INDEPENDENT) SAMPLE T-TEST (a)Describe the independent samples t-test for two means briefly. How does it do it? (b) State the null and the alternative hypothesis. (c) State the assumptions. (d) State the formula for the test statistic. (e) State the rejection rule with (How to reject the null hypothesis) (f) Give an real life example of how we can use the independent samples t-test for two means.
The MINITAB printout shows a test for the difference in two population means. Two-Sample T-Test and...
The MINITAB printout shows a test for the difference in two population means. Two-Sample T-Test and CI: Sample 1, Sample 2 Two-sample T for Sample 1 vs Sample 2      N Mean StDev SE Mean Sample 1 5 29.00 4.00 1.8 Sample 2 9 28.86 4.61 1.5 Difference = mu (Sample 1) - mu (Sample 2) Estimate for difference: 0.14 95% CI for difference: (-5.2, 5.5) T-Test of difference = 0 (vs not =): T-Value = 0.06 P-Value = 0.96...
In excell t-Test Assuming Equal Variances t-Test With Paired Two Samples for Means Analysis of Variance...
In excell t-Test Assuming Equal Variances t-Test With Paired Two Samples for Means Analysis of Variance Correlation Coefficient Simple Regression Skills and self-esteem are believed to influence job performance. To investigate this, an experimenter split 14 recent parolees into "high skill and self-esteem" and "low skill and self-esteem" groups. Three months later, employers were asked to rate each parolee’s job performance on a standard test that gives ratings from 1 to 10, with 10 being the highest. The following ratings...
A t-test is used to compare the means of one variable for two groups of cases....
A t-test is used to compare the means of one variable for two groups of cases. As an example, a practical application would be to find out the effect of a new drug on blood pressure. Patients with high blood pressure are randomly assigned into two groups, a placebo group and a treatment group. The placebo group would receive conventional treatment while the treatment group would receive a new drug that is expected to lower blood pressure. After treatment for...
The Independent Samples t Test can only compare the means for two (and only two) groups....
The Independent Samples t Test can only compare the means for two (and only two) groups. It cannot make comparisons among more than two groups. If you wish to compare the means across more than two groups, you will likely want to run an ANOVA. What is the main differences between an unpaired and paired t-test? Why would you want to limit the number of variables you are comparing? Why would you want to start with two groups and work...
The Independent Samples t-Test compares the means of two independent groups to determine whether there is...
The Independent Samples t-Test compares the means of two independent groups to determine whether there is statistical evidence that the associated population means are significantly different. The Independent Samples t-Test is a parametric test. Give an example of two variables you would compare, what your theory is and the hypothesis, and how you would find the independent samples t-test in SPSS.
When Comparing means using the 2 Sample t Test: (A) How many tails are appropriate for...
When Comparing means using the 2 Sample t Test: (A) How many tails are appropriate for this test and why? (B) What assumptions are made by your test? (C) In general, what form of data model is this analysis most appropriate for? (How many IVs and DVs?)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT