Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72793

Different p value from ttest and logit

$
0
0
Hi,
maybe I am overlooking something very simple here. Anyways:

I have a dataset of 29 observations and a range of variables. The observations are given biological structures, and we are studying whether they have changed from time A to time B (a very unspecific explanation, but will do for now). If the structure has changed, it has the value "1" in a "Changed" variable. Non-changing structures are given "0".

I want to test whether there is difference present at time A between those structures that subsequently changed, and those that did not. I have ttest and logit. In the following example, the variable describing the structure at time A is called pre_Structure

T-test:
Here, I am testing as follows:
. clonevar pre_StructureAmongNochange = pre_Structure if Changed == 0
(15 missing values generated)

. clonevar pre_StructureAmongChanged = pre_Structure if Changed == 1
(14 missing values generated)

. ttest pre_StructureAmongChanged == pre_StructureAmongNochange, unpaired


Test results:
Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
pre_St~d | 15 15.9 2.46366 9.541713 10.61598 21.18402
pre_St~e | 14 8.421429 1.213508 4.540532 5.799804 11.04305
---------+--------------------------------------------------------------------
combined | 29 12.28966 1.548731 8.340171 9.117224 15.46209
---------+--------------------------------------------------------------------
diff | 7.478571 2.808917 1.71515 13.24199
------------------------------------------------------------------------------
diff = mean(pre_SMaxChanged) - mean(pre_SMaxNoChange) t = 2.6624
Ho: diff = 0 degrees of freedom = 27

Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.9935 Pr(|T| > |t|) = 0.0129 Pr(T > t) = 0.0065



Logistic regression:
Here, I am testing as follows:
logit Changed pre_Structure

Test results:
Logistic regression Number of obs = 29
LR chi2(1) = 7.34
Prob > chi2 = 0.0067
Log likelihood = -16.414763 Pseudo R2 = 0.1827

----------------------------------------------------------------------------------
Changed | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-----------------+----------------------------------------------------------------
pre_Strucutre | .1712605 .0846815 2.02 0.043 .0052879 .3372331
_cons | -1.852314 .9571973 -1.94 0.053 -3.728387 .0237579
----------------------------------------------------------------------------------


I prefer using logit, since that allows me to adjust for other variables as well. However, the p value is lower when using ttest. Why?

Thankyou in advance.

Viewing all articles
Browse latest Browse all 72793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>