Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Gwinyai Masukume <parturitions@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: R: one-sample t test query |
Date | Mon, 13 Jan 2014 13:06:00 +0200 |
Dear Phil and Carlo, Many thanks for your help. Appreciated. Thanks, Gwinyai On 1/13/14, Carlo Lazzaro <carlo.lazzaro@tiscalinet.it> wrote: > Dear Gwinyai, > I would suggest to move from -ttest- to -prtest-, as your testing > proportions (and not continuous variables): > > prtest sex_baby == 0.515 //sex_baby is 1 for males > > one-sample test of proportion sex_baby: Number of obs = > 32 > ---------------------------------------------------------------------------- > -- > Variable | Mean Std. Err. [95% Conf. > Interval] > -------------+-------------------------------------------------------------- > -- > sex_baby | .375 .0855816 .207263 > .542737 > ---------------------------------------------------------------------------- > -- > p = proportion(sex_baby) z = > -1.5846 > Ho: p = 0.515 > > Ha: p < 0.515 Ha: p != 0.515 Ha: p > > 0.515 > Pr(Z < z) = 0.0565 Pr(|Z| > |z|) = 0.1130 Pr(Z > z) = > 0.9435 > > > Luckily enough, your conclusion is still valid: given your sample, there is > no evidence that 37.5% is significantly different from 51.5% if p < 0.05 is > considered significant. > > Kind regards, > Carlo > -----Messaggio originale----- > Da: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Gwinyai Masukume > Inviato: lunedì 13 gennaio 2014 10:22 > A: statalist > Oggetto: st: one-sample t test query > > Hi Stata list, > > I have a dataset with 32 observations (20 females and 12 males). Males thus > constitute 37.5% of the observations. Normally males should constitute > 51.5% > of the observations. I want to test if the observed 37.5% males are > different from 51.5%. I have issued the following Stata command: > > . ttest sex_baby = 0.515 > > One-sample t test > ---------------------------------------------------------------------------- > -- > Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. > Interval] > ---------+-------------------------------------------------------------- > ---------+------ > sex_baby | 32 .375 .086951 .4918694 .1976622 > .5523378 > ---------------------------------------------------------------------------- > -- > mean = mean(sex_baby) t = > -1.6101 > Ho: mean = 0.515 degrees of freedom = > 31 > > Ha: mean < 0.515 Ha: mean != 0.515 Ha: mean > > 0.515 > Pr(T < t) = 0.0588 Pr(|T| > |t|) = 0.1175 Pr(T > t) = > 0.9412 > > Looking at the two-tailed p-value, I conclude that 37.5% is not > significantly different from 51.5% if p < 0.05 is considered significant. > Have I used the correct Stata command and is my interpretation correct? > > Thanks, > Gwinyai > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/