[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: permutations
Christopher Intemann <email@example.com>
Re: st: permutations
Fri, 14 Mar 2008 11:44:48 +0100
Am 13.03.2008 um 15:24 schrieb David Airey:
I was using a pre-stata9 syntax of the permute command.
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 http://www.ats.ucla.edu/stat/stata/notes/hsb2, 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.
However, a command like
xi:permute affected_stata x2=e(chi2):logistic affected_stata i.gene age ethno_x sex_x
does calculate some permutations, but is pretty sure not what I want:-(
As i could calculate my p-values from the matrices e(b) and e(V), which are generated by logistic, i would rather like to use these in the exp_list. However, this does not work:
"matrix operators that return matrices not allowed in this context"
Is there any other way to permute or calculate the p-values?
Just similar to what other programs for genetic analysis (like unphased, plink or haploview) do?
I just came along cvpermute, maybe this could do the trick?
Many thanks in advance,
* For searches and help try: