# Re: st: permutations

 From Christopher Intemann To statalist@hsphsun2.harvard.edu Subject Re: st: permutations Date Fri, 14 Mar 2008 11:44:48 +0100

```Hi Dave
Am 13.03.2008 um 15:24 schrieb David Airey:

```
.

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.

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):

use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear

* run logistic predicting "goodread" from "write"

* 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.

I was using a pre-stata9 syntax of the permute command.

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?