[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: permutations

From   David Airey <david.airey@Vanderbilt.Edu>
Subject   Re: st: permutations
Date   Thu, 13 Mar 2008 09:24:05 -0500


Do you have access to the manual help or online help? The syntax is:

permute permvar exp_list [, options] : command

You specified permvar but not exp_list, so I'm not sure what permute is defaulting to, maybe just the overall model statistic? You can write a small program to return the coefficients for the genetic dummy variables, and an overall test of those, that gets called by permute. The ANOVA example in the printed help shows how to do this.

T is your statistic
T(obs) is your observed statistic
c is the number of times the statistics is greater than T(obs)
n is the default number of permutations since you didn't specify this either

Below is an example from ATS UCLA (Stata version 9/10):

* read your data into Stata
use, clear
generate goodread = (read > 60)

* run logistic predicting "goodread" from "write"
logit goodread female

* run permutation test for above with 10000 repetitions
permute female x2=e(chi2), reps(10000) nodots: logit goodread female

Since you want a statistic for the individual dummy variables and the test for both genetic dummy variables, you don't just want the results from the overall test, and you cannot just collect that using permute as the above example does.


On Mar 13, 2008, at 4:46 AM, Christopher Intemann wrote:

I just realized that stata is capable of doing permutations.
However, I find it quite difficult to figure out how:-)
Within the scope of a genetic analysis I'm using a command like:

xi:logistic affected_stata i.gene age ethno_x sex_x

where gene is coded as 1/2/3, referring to genotypes AA/AG/GG (for instance).
The result is corrected for confounders age, ehtnicy and sex.

I played around a bit. I was trying this command line:

permute affected_stata "xi:logistic affected_stata i.MCP1_7656en age ethno_x sex_x" e(chi2)

and I got a result which is probably wrong (or at least I don't understand it):

Monte Carlo permutation statistics Number of obs = 4356
Replications = 100

T | T(obs) c n p=c/n SE(p) [95% Conf. Interval]
------------- +----------------------------------------------------------------
_pm_1 | 76.09804 0 100 0.0000 0.0000 0 .0362167

Well. Any help would be appreciated:-)
Many thanks in advance,
* For searches and help try:
*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index