Test 2: confidence intervals and tests
Download your data. In Stata, type:
use http://web.missouri.edu/~kolenikovs/Stat3500/test2/data-test2-#####.dta, clear
where ###### is your course ID number in the upper right hand
corner of your syllabus.
The exercise concerns confidence intervals and testing statistical
hypotheses.
With this data, answer the following questions, reporting the
results with four accurate decimal points if that is a non-integer number:
- What is the mean of variable x?
- Test hypothesis that the mean of x is equal to 2.7
with a two-sided alternative.
Report the p-value.
- Should the null hypothesis be retained or rejected at 5% level?
Enter 1 if the null is rejected, and 0 if the null is retained.
- Identify the confidence interval in the test output.
Report the 90% confidence interval, with Answers to Question 4
being the left limit...
- ... and the Answer to Question 5 being the right limit.
- Variable group contains information on whether the
observation belongs to group 1 or group 2. Test the hypothesis
that the proportion p in group 1 is at least 0.50, with
one-sided alternative. So, H0: p ≥ 0.5,
H1: p < 0.5. Report p-value of the test.
- Should the null hypothesis be retained or rejected at 10% level?
Enter 1 if the null is rejected, and 0 if the null is retained.
- Let us now compare the values of variable y between
the two groups. For question 8, report the mean of group 1.
- Report the mean of y in group 2.
- Report the difference in group means.
- The default null hypothesis is H0: there are no differences
between group means. What is the value of t-statistic?
- What is the degrees of freedom of t-statistic?
- If the alternative hypothesis is two-sided, should the null
be retained or rejected at 10% level?
Enter 1 if the null is rejected, and 0 if the null is retained.
- A modification of t-test can account for differences
in variances between the two groups. This can be done with
unequal option of ttest. Try it out.
First of all, did the reported mean change? For question 14, enter 0
if they did not change, and 1 if they did change.
- Report the value of t-statistic.
- What is the degrees of freedom of t-statistic?
Note that it might be a fractional number, and that is expected.
- If the alternative hypothesis is two-sided, should the null
be retained or rejected at 10% level?
Enter 1 if the null is rejected, and 0 if the null is retained.
- Does it make a difference whether the correction for different
variances is made? Enter 0 if your test results are the same,
enter 1 if they are different.
Create a file called answers-test2-#####.dta with two
variables, Question and Answer. (Capitalization is
important in the variable names!) The first variable will contain
the question number, and the second variable, your numeric answer.
In Stata, this can be achieved using post commands (see help post):
. postfile test2 Question Answer using answers-test2-#####,
replace
. post test2 (1) (your answer here)
. ...
. postclose test2
Parentheses in the post command are important!
Upload the resulting file to the blackboard. Go to: Assignments
/ Stata Assignments / Stata test2 / View and complete assignment. In
panel 2, there is "Attach local file" window -- that's where your
answers-test2-#####.dta will go. Click "Submit" to finish.