Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • In permute, how does one specify p-values from a regression model?

    I would like to generate permutations of a y var and examine the resulting distribution of p-values for the beta of an x var (specifically, an interaction of two x vars).

    My code so far is as follows:
    gen interxn=x1*x2, where x2 has multiple levels and I chose to use indicator variables for each term in the regression model below

    permute y _b, reps(1000) : regress y x1 x2 i.interxn

    This command allows me to see the resulting betas for each predictor in the model, but I would prefer instead to look at the p-values for each beta (as opposed to betas). So is there a way to specify this in the permute command or does one have to do something more complex (apologies if there's an obvious answer to this)?

  • #2
    If you really want to do this, you can trick Stata into doing it, but it defeats the whole purpose of using a permutation test. The whole idea behind permutation tests is to ignore the p-value from the basic analysis and to instead simulate multiple draws of data (by permuting some of the variables) and then determine as a p-value the fraction of the draws that lead to a result more extreme than the one observed in the basic analysis. The whole idea behind it is that you don't believe in the p-values from the underlying analysis. So it really makes no sense to use those p-values in the permutation test.

    Nevertheless, if you must:

    Code:
    permute y p_value = (Ftail(e(df_m), e(df_r), e(F))), reps(1000): regress y x1 x2 i.interxn
    will force Stata to calculate this.

    By the way, your description of how you developed interaction terms is vague, so I can't be certain what' you've actually done, but it doesn't sound right to me. And if x2 is a category variable with multiple levels, it shouldn't be specified as x2 in the regression: it should be i.x2. For both of these issues, do read -help fvvarlist- for the correct use of factor variable notation in connection with discrete variables and interaction terms.

    Comment

    Working...
    X