Hello,
I have about 20 variables in a regression model and would like to test each among each other if they are equal, like that:
test _b[Var1] ==_b[Var2]
My idea was to create a nested for loop and save r(p) for each of the 20x20 tests in a matrix which I obtain as output eventually. At best the values that will be there twice will be deleted.
I thought about creating to local variables which contain the names of all variables and then do something like that:
However, I don't know how to do that in Stata.
I would be happy if someone could help me with that.
Best wishes,
Peter
I have about 20 variables in a regression model and would like to test each among each other if they are equal, like that:
test _b[Var1] ==_b[Var2]
My idea was to create a nested for loop and save r(p) for each of the 20x20 tests in a matrix which I obtain as output eventually. At best the values that will be there twice will be deleted.
I thought about creating to local variables which contain the names of all variables and then do something like that:
Code:
foreach i in varlist { foreach j in varlist { quietly test _[`i']==_[`j'] matrix a = r(p) if row ==`i' & column == `t' } } display a
I would be happy if someone could help me with that.
Best wishes,
Peter
Comment