Week 6: Using the 1-Sample t test to calculate confidence intervals: We will calculate the 95% confidence interval of the variable age in the dataset alcohol.sav here. For your assignment you will...


Week 6: Using the 1-Sample t test to calculate confidence intervals:

We will calculate the 95% confidence interval of the variable age in the dataset alcohol.sav here. For your assignment you will calculate the 95% confidence interval of the variable weight in the dataset body-weight.sav.
Be sure to interpret your findings.

Open SPSS and then use the file/open/data command to open the dataset alcohol.sav. Next select
Analyze > Compare Means > One-Sample T Test


Select the variable Age; move it to the
Test Variable(s)
box. Make sure 0 is entered in the
Test Value
box (that should be the default).
Click on
Options, and make sure that the
Confidence Interval Percentage
box shows 95% (that should be the default).
Click
Continue; Click
OK.
In the output you should get the following:






















One-Sample Statistics
NMeanStd. DeviationStd. Error Mean
age71337.6912.114.454


































One-Sample Test
Test Value = 0
tdfSig. (2-tailed)Mean Difference95% Confidence Interval of the Difference
LowerUpper
age83.071712.00037.68636.8038.58

Because the test value is 0, the mean difference in the second box is equal to the sample mean in the first box (both are highlighted in yellow). Since we are using a sample and do not know the population standard deviation we use the t test with N-1 degrees of freedom where N is the sample size (713). The significance of the t test is .000. This tells us that the sample mean is significantly different from the test value. Since the test value is 0 this is not surprising.
The lower 95% confidence limit is 36.8 years and the upper 95% confidence limit is 38.58 years. This gives us a range of possible values within which the true population mean might fall. If we take 100 samples of the same size, and construct 100 confidence intervals, then 95 of them would contain the true population mean age, and 5 of them would not. The confidence interval is rather small since the sample size is so large. If we changed the 95% (default setting) in the options to 99% or 90% we would get different results. Try it for yourself and see what happens.
We can use the confidence interval to determine if any samples we draw are from the same population or from one with a different age distribution. Samples drawn from the same population will have means within the 95% confidence interval (at least 95% of the time) while samples drawn from other populations will probably have means outside the confidence interval. So if we drew a sample and found the mean age was 34, we would question whether the sample was drawn from the same population.
We can also use the 1-sample t-test to test whether a sample mean is significantly different from a hypothesized one. Suppose we hypothesized that the mean age was 36.5. We draw a sample from the population and compare it to 36.5.
To do this we again use
Analyze > Compare Means > One-Sample T Test


Select the variable Age; move it to the
Test Variable(s)
box.
BUT
this time change the
Test Value
to
36.5
instead of the default setting of 0. Click on
Options, and make sure that the
Confidence Interval Percentage
box shows 95% (that should be the default). Click
Continue; Click
OK. Now your output will look like this:






















One-Sample Statistics
NMeanStd. DeviationStd. Error Mean
age71337.6912.114.454


































One-Sample Test
Test Value = 36.5
tdfSig. (2-tailed)Mean Difference95% Confidence Interval of the Difference
LowerUpper
age2.614712.0091.186.302.08

The first box has not changed. The mean of your sample is still 37.69 with a standard deviation of 12.114 and a sample size (N) of 713. The second box, however, looks very different. Now the mean difference is the difference between the mean and 36.5 (not 0) so it is not the same number as the mean. The confidence interval here is related to the difference between 37.69 and 36.5 and does not really help you test any hypotheses. But now the significance (Sig.(2-tailed) does help you test a hypothesis. If your null hypothesis was that the mean weight of the sample was not different from 36.5 (or µ = 36.5) then the significance of .009 would allow you to reject the null hypothesis. Note that while the p value (significance) is still less that .05 it is not as small as it was when we were comparing the mean weight to 0. Try other test values and see how the significance level changes. When are you unable to reject the null hypothesis?

Week 7: Inference for the Mean Application Assignment

Complete the problems listed below. If you get stuck or have questions, review the video lecture and work with your study group members. If you are still stuck, please contact the instructor.

Assignment


Problem 1:
Download the fluoride.sav data set and use it to answer the research question: "Is there is a change in the mean number of cavity-free children per 100 before and after the public water fluoridation project?" Use SPSS to complete the following calculations:
(1) Run a one-sample
t
test on DELTA.
(2) Run a paired-sample
t
test for the before and after mean numbers of cavity-free children to answer this research question.
(3) Calculate a 95% confidence interval for the mean change.

  • Week 7 Data Set: Fluoride.sav


Problem 2:
Download the data set histidine.sav and use it to answer the research question: "Is there a mean difference in the 24-hour histidine excretion among men and women?" Use SPSS to complete the following calculations:
(1) Run a two-sample independent
t
test.
(2) Calculate a 95% CI for the mean difference in the 24-hour histidine excretion levels among men and women.

  • Week 7 Data Set: Histidine.sav


For problem 2, question #1, comment on which version of the
t
test we should use (equal variance or unequal variance) and why?
Be sure to copy and paste any required data charts or summaries into a Word document, or export the data output as a Word/RTF document

Week 7 Application Assistance


Problem 1:
In the first problem you are asked to use two types of t tests to compare paired samples. Both should give you the same results. First let’s talk about what a paired sample is. In this application example, both of the samples are the same – same people just different times. We assume that the variances are equal and that other characteristics are also the same – the two groups are very closely matched as they are the same people – just different times. Here are some other ways you may have a paired sample: same people/different parts of body (examples left versus right arm, left versus right ear, different teeth), twin studies (identical twins), and very carefully matched case-control studies. The assumption is that the variance is equal and the test does not even allow you to choose otherwise.
The first test you are asked to perform is a one-sample t test on Delta. You have already used this test in week 6. Here you are using it on the variable delta (which means change). The delta variable has been created by subtracting the “before” number from the “after “number. If we look at the data in fluoride.sav we see the following numbers:
49.2 18.2 31.0
30.0 21.9 8.1
16.0 5.2 10.8
47.8 20.4 27.4
3.4 2.8 .6
16.8 21.0 -4.2
10.7 11.3 -.6
5.7 6.1 -.4
23.0 25.0 -2.0
17.0 13.0 4.0
79.0 76.0 3.0
66.0 59.0 7.0
46.8 25.6 21.2
84.9 50.4 34.5
65.2 41.2 24.0
52.0 21.0 31.0
The first column represents the after data, the second the before and the third is the delta or difference between them.
First, we run a 1-sample t-test on Delta (the difference in mean scores between After and Before). In SPSS go to:
Analyze > Compare Means > One-Sample T Test


Move the variable Delta to
Test Variable(s)
box; make sure that the
Test Value
is set to 0. Click
OK.
The null hypothesis in this case claims that the mean difference is 0 (i.e. there is no difference in After scores and Before score, i.e., the intervention produced no change). The alternative hypothesis claims that the mean difference is significantly different from 0 (i.e., the intervention is effective).
To demonstrate how to do this and not actually do it for you I have used only the first 6 records from fluoride.sav
49.2 18.2 31.0
30.0 21.9 8.1
16.0 5.2 10.8
47.8 20.4 27.4
3.4 2.8 .6
16.8 21.0 -4.2
You can try this and see if you get the same results by highlighting and cutting records 7 through 16 in your dataset. Just make sure you do not save the set with only 6 records instead of the full one with 16 when you exit SPSS.
When I run the one-sample test with the abbreviated sample I get the following output:


























































One-Sample Statistics
NMeanStd. DeviationStd. Error Mean
delta612.28314.18965.7929

One-Sample Test
Test Value = 0
tdfSig. (2-tailed)Mean Difference95% Confidence Interval of the Difference
LowerUpper
delta2.1205.08712.2833-2.60827.174


Our null hypothesis is that delta is equal to 0 (the test value). Since our Sig. (2-tailed) is greater than .05 we are unable to reject the null hypothesis. We cannot say that there was a change in
the mean number of cavity-free children per 100 before and after the public water fluoridation project. If we look at the 95% confidence interval we see that 0 fits between the two extremes. This supports our failure to reject the null hypothesis. In 95 of 100 samples the true mean is between -2.608 and 27.174. Zero may be the true mean as it is in that range – since a delta of 0 means there has been no change we cannot reject the null hypothesis.
Next you are asked to run a paired-sample t test for the before and after mean numbers of cavity-free children to answer this research question. The paired sample t test is a special t test that can only be used when you are sure you have paired samples. In this test you do not need the variable delta as SPSS calculates this while performing the t test. If you had a very large dataset with a before and after or observations from twins and had not already created a delta variable you could use this test and save yourself a step.
In SPSS, go to:

Analysis > Compare Means > Paired-Samples T Test


Under Pair 1, move After and Before into Variable 1 and Variable 2, respectively. Click
OK.
SPSS produced the following again using the abbreviated dataset with only 6 records:
































































































Paired Samples Statistics
MeanNStd. DeviationStd. Error Mean
Pair 1after27.200618.52707.5636
before14.91768.57733.5017

Paired Samples Correlations
NCorrelationSig.
Pair 1after & before6.678.139



Paired Samples Test
Paired DifferencestdfSig. (2-tailed)
MeanStd. DeviationStd. Error Mean95% Confidence Interval of the Difference
LowerUpper
Pair 1after - before12.283314.18965.7929-2.607827.17442.1205.087


In this output you should ignore the table titled Paired Samples Correlations. Focus instead on the Paired Samples Test. Here the numbers are displayed differently than in the 1-sample test but you can see that they are the same numbers. SPSS subtracted the variable you put in the variable 2 box from the one in the variable 1 box. If you had put before in box 1 and after in box 2 you would get the same significance but the mean would be -12.2833 because SPSS would have subtracted the after from before instead of before from after.
Again the interpretation of this output is that we cannot reject the null hypothesis. The exact same interpretation we had with the 1-sample test.

Problem 2:
The second problem requires you to use a two-sample independent
t
test. This is because the data does not meet the requirements for a paired t test. In this case the data are collected independently and we do not know how similar the variances (or the distribution of the samples) are to each other. If we sample independently we can have very different distributions in our two groups. So instead of comparing apples to apples and oranges to oranges we would compare apples to oranges – definitely not good. Review the types of matched samples listed in problem 1 – only with these can we assume that the distributions are the same or close enough to allow a direct comparison. Generally when you have independent samples you go the safe route and assume that the variances are not the same (see Gerstman page 247 for more on this). However SPSS allows you to test the equality of variances in the same step as you test the equality of the means.
In SPSS, go to:

Analyze > Compare Means > Independent Samples T-Test


Move Histidine to
Test Variable(s)
box; move Group to
Grouping Variable; click on
Define Groups. Be sure that
Use specified values
is selected. Now enter 1 for
Group 1, and enter 2 for
Group 2. Click
Continue; click
OK.
SPSS produced the following details using the first 2 records and the last 3 records of histidine.sav (cut records 3 through 8:




































































































































Group Statistics
groupNMeanStd. DeviationStd. Error Mean
histidinmen2232.504.9503.500
women3149.0021.70312.530

Independent Samples Test
Levene's Test for Equality of Variances
FSig.
histidinEqual variances assumed5.743.096
Equal variances not assumed

Independent Samples Test
t-test for Equality of Means
tdfSig. (2-tailed)Mean Difference
histidinEqual variances assumed5.0963.01583.500
Equal variances not assumed6.4182.296.01683.500

Independent Samples Test
t-test for Equality of Means
Std. Error Difference95% Confidence Interval of the Difference
LowerUpper
histidinEqual variances assumed16.38531.355135.645
Equal variances not assumed13.01033.907133.093

In SPSS the last three tables are grouped into 1 table but it does not fit on this page so it is divided up here.
The first table provides you with some descriptive statistics for each group. We see that there 2 men (group1) and 3 women (group2). We also see the mean histidine excretion values for each group. Just looking at the difference in means we might be tempted to conclude that they are different but we must use the t test to determine this. We can also see that there is a difference in the std deviations of the two groups.
The next table shows us the results of Levene’s Test for Equality of Variances. This test yields the F statistic and it is interpreted in a similar way to the t test for means. Here the null hypothesis is that there is no difference in the variances of the two groups. Looking at them in table 1 we want to reject the null, however the sig is .096 and since this is higher than .05 we cannot reject the null hypothesis and therefore must assume that the variances are equal.
The next table offers you 2 t test results. The first result (first row) assumes equal variances and the second one does not. Since we are assuming equal variances based on the F statistic and its significance we can ignore the second set of numbers (row 2). Now we can address the hypothesis for problem 2. The question was "Is there a mean difference in the 24-hour histidine excretion among men and women?" and our null hypothesis based on this is: There is no significant difference between the mean 24-hour histidine excretion in men and the mean 24-hour histidine excretion in women. Based on the Sig. (2-tailed) (also known as p value) in table 3 we can reject this null hypothesis. The p value here is .015 and this is less than .05 which allows us to reject the null hypothesis.
The final table gives us the confidence interval associated with the difference between the two means. Notice that unlike the 95% confidence in problem 1 above, this confidence interval does not bracket 0. Zero was not the mean in 95 of 100 samples tested and so we feel pretty confident that the means are not the same. This confirms the decision to reject the null hypothesis based on the p value in table 3.
May 14, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here