Question

In: Economics

Use student-t to derive the following paired test set.seed(20) girls_height<- rnorm(50, mean = 160, sd =...

Use student-t to derive the following paired test
set.seed(20)
girls_height<- rnorm(50, mean = 160, sd = 30)
boys_height<- rnorm(50, mean = 172, sd = 30)

#-------------------------------------------------------------
State the hypothesis for the paired-test of the mean of
# girls' height and boys' height.

Check the three assumptions before running the student t test
# for the samples. You need to write and run the code, and
# report the results.

Solutions

Expert Solution

The required commands generate the required variables. The null hypothesis of the paired t-test of the mean of two groups would be and the alternate would be , where D is the true/population mean difference.

The assumptions and their verification are as below (note that there are different assumptions in different text books, but major four assumptions are stated).

  • The variables must be interval or ratio scale. This can be checked by looking at the data itself, via simple R-commands as below.
    ----------------------------------------------------
    > View(girls_height)
    > View(boys_height)
    ----------------------------------------------------
  • The observations are independent from one another. The test of correlation coefficient can be done in this regard as below. The null would be , and alternate would be . The t-statistic would be .
    ----------------------------------------------------

    > cor.test(girls_height,boys_height)

       Pearson's product-moment correlation

    data: girls_height and boys_height
    t = 1.2589, df = 48, p-value = 0.2142
    alternative hypothesis: true correlation is not equal to 0
    95 percent confidence interval:
    -0.1047890 0.4354522
    sample estimates:
          cor
    0.1787731

    ----------------------------------------------------
    As can be seen, p-value is 0.2142, meaning that the test statistic is not significant at 1% or 5%, or even 10%. Hence, the two variables are independent of each other. The critical t at 10% alpha would be , and the calculated t is less than that.
  • The variables should be normally distributed. This can be checked via Jarque-Bera test (JB test), in which the null hypothesis is that the variable is not different from a normal distribution, and the alternate is that the variable is indeed different from a normal distribution. The R-commands are as below (package 'tseries' is required, along with dependencies of that).
    ----------------------------------------------------

    > jarque.bera.test(girls_height)

       Jarque Bera Test

    data: girls_height
    X-squared = 0.68004, df = 2, p-value = 0.7118

    > jarque.bera.test(boys_height)

       Jarque Bera Test

    data: boys_height
    X-squared = 0.24858, df = 2, p-value = 0.8831

    ----------------------------------------------------
    As can be seen, both the p-values fail to reject the null, which means that both the variables are not significantly different from a normal distribution.
  • The variables should not contain any outlier. This can be confirmed via Grubb's test, with the R-commands as below (this requires the package 'outliers', may be installed without dependencies).
    ----------------------------------------------------

    > grubbs.test(girls_height)

       Grubbs test for one outlier

    data: girls_height
    G = 2.61871, U = 0.85719, p-value = 0.1704
    alternative hypothesis: lowest value 73.3084715675764 is an outlier

    > grubbs.test(boys_height)

       Grubbs test for one outlier

    data: boys_height
    G = 2.33549, U = 0.88641, p-value = 0.4174
    alternative hypothesis: lowest value 112.95922652111 is an outlier

    ----------------------------------------------------
    As can be seen, both the p-values fail to reject the null that there is no outliers.

As all the assumptions are verified, we may proceed to do the paired t-test. This can be done manually and via R-commands. Both are done as below.

The commands to test the variables directly is as below.

----------------------------------------------------

> t.test(girls_height,boys_height,paired = T)

   Paired t-test

data: girls_height and boys_height
t = -4.0983, df = 49, p-value = 0.0001559
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-32.60696 -11.15059
sample estimates:
mean of the differences
              -21.87877

----------------------------------------------------

As can be seen, the mean difference is significantly different from zero since the t-statistic is significant at 5% or even at 1% alpha. The low p-value of 0.0001559, less than 0.05 or 0.01 states that we may reject the null hypothesis, which states true mean is equal to zero.

The manual method would be as below.

----------------------------------------------------

> d <- girls_height - boys_height
> t <- mean(d)/(sd(d)/(50^0.5))
> abs(t) > qt(0.995,50-1)
[1] TRUE
> (pt(t,50-1))*2
[1] 0.0001559402

----------------------------------------------------

The difference variable is basically , and the t-statistic is , and since the standard error of the difference variable would be , for sd(d) be the sample (not population) standard deviation, we have the t-statistic as . The founded t-statistic is also equal to the direct command t-statistic. As the absolute value of the t-statistic is greater than the critical t at 0.01 alpha, we reject the null that the true difference is zero. The the critical t is . The p-value is also given just as before, which is less than 0.01 alpha.

Hence, the conclusion would be that, the difference between the height of girls and boys for the given data is significantly different.


Related Solutions

student_id=100 set.seed(student_id) Group1=round(rnorm(15,mean=10,sd=4),2) Group2= round(rnorm(12,mean=7,sd=4),2) For this question you are not allowed to use the lm()...
student_id=100 set.seed(student_id) Group1=round(rnorm(15,mean=10,sd=4),2) Group2= round(rnorm(12,mean=7,sd=4),2) For this question you are not allowed to use the lm() command in R or the equivalent of lm() in python or other software. If you want to use a software, only use it as a calculator. So if you are using R, you may only use mean(), sum(), qt() and of course +,-,*,/. (Similar restrictions for Python, excel or others). Consider all the 27 numbers printed under Group1 and Group2 as your y values,...
Paired t-test Execution For this question use the following values: n = 13,sD = 1.20, andd...
Paired t-test Execution For this question use the following values: n = 13,sD = 1.20, andd = -1.01.Compute the upper limit of the 93% confidence interval on the differencebetween population means. Group of answer choices -0.955 -0.787 -0.507 -0.434 -0.348 -0.090 0.044 0.103 0.132 0.690
In which of the following situations would it be appropriate to use a paired t-test to...
In which of the following situations would it be appropriate to use a paired t-test to analyze the data? Check all that apply. A researcher was interested in the differences in attitudes towards saving money and eliminating debt between couples who are engaged to be married. As part of a premarital counseling program, 45 engaged couples filled out a survey that assessed their attitudes towards financial matters such as their priorities for saving money and eliminating debt. The researcher compared...
For the following, indicate whether you should use a one sample t-test, paired t-test, or two...
For the following, indicate whether you should use a one sample t-test, paired t-test, or two sample t-test and whether you have chosen a one-sided or two-sided alternate hypothesis: A) Do macroeconomics students at Vanderbilt score significantly higher on the Math SAT than the national average? My Answer: One sample t-test, one tailed B) Do macroeconomics students at Vanderbilt score significantly higher on the Verbal SAT than the national average? My answer: One sample t-test, one tailed C) Report a...
1. Identify which test the scenario will use: independent samples t test, paired samples t test,...
1. Identify which test the scenario will use: independent samples t test, paired samples t test, chi square test for goodness of fit, chi square test for independence or chi square test for homogeneity. A. A researcher goes to the parking lot at a large grocery chain and observes whether each person is male or female and whether they return the cart to the correct spot before Chi leaving (yes or no). B. Amber Sanchez, a statistics student, collected data...
Answer the following questions using the data given in the table. Use the T-Test Paired Two...
Answer the following questions using the data given in the table. Use the T-Test Paired Two Sample for Means to arrive at the solutions to the questions below. Use an alpha value of 0.01 Home Appraiser 1 Appraiser 2 A $235,000 $228,000 B $210,000 $205,000 C $231,000 $219,000 D $242,000 $240,000 E $205,000 $198,000 F $230,000 $223,000 G $231,000 $227,000 H $210,000 $215,000 I $225,000 $222,000 J $249,000 $245,000 K $199,000 $201,000 1 What is the value for the test...
Imagine that a researcher is conducting a paired-samples t test. She finds that the sample mean...
Imagine that a researcher is conducting a paired-samples t test. She finds that the sample mean difference is 3.665, the standard deviation of the difference scores is 9.334, and the sample size is 75. The researcher is also using a typical null hypothesis that proposes no differences between the relevant population means. Under these circumstances, what is the value of Cohen's d? Please retain a minimum of three decimal places for all steps (if relevant) and provide a minimum of...
Paired-/Related Samples T-test Use it to test whether there is a difference between the two conditions(note:...
Paired-/Related Samples T-test Use it to test whether there is a difference between the two conditions(note: conditions must be RELATED-participants provide in each condition). You are interested in the relationship satisfaction of young adults before and after they go off to college/university, which separates them from their sweetheart. You asked four couples to rate the satisfaction of their relationship (on a scale of 0-50) before leaving for school and then again after a semester. Here are the data: Pair Before...
Use Excel to test. For each paired difference, compute After – Before. In Data Analysis, t-Test:...
Use Excel to test. For each paired difference, compute After – Before. In Data Analysis, t-Test: Paired Two Sample for means, select the After data for Variable 1 Range. Note that the critical value output by Data Analysis for this test is always positive. In this problem, the sign of the critical value is negative corresponding to 1-tailed test with lower reject region and negative lower critical value.                Person   Before   After    1   176   164   ...
For what kind of data and analysis do you use a paired t-test and for what...
For what kind of data and analysis do you use a paired t-test and for what kind of data and analysis do you use a non-paired t-test? Be sure to clearly define each of these and illustrate your answer with realistic behavioral examples. The examples used for each must relate to each other, i.e., the one must be a slight modification of the other and use the same organism/system [e.g., if your example for a paired t-test involves elephant breeding,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT