Hi All,
I am getting stuck on my thinking of how to loop over all pairwise combinations of levels of a variable to be used in an inlist(). More specifically, assume we have 7 doses of a drug and we'd like to run pairwise comparisons of the dosages. The code below is what I started with, but the obvious problem is that this is not limited to only pairwise comparisons, and it will rerun pairs twice (e.g. 0/10, and then again 10/0).
Any help will be appreciated!
Ariel
I am getting stuck on my thinking of how to loop over all pairwise combinations of levels of a variable to be used in an inlist(). More specifically, assume we have 7 doses of a drug and we'd like to run pairwise comparisons of the dosages. The code below is what I started with, but the obvious problem is that this is not limited to only pairwise comparisons, and it will rerun pairs twice (e.g. 0/10, and then again 10/0).
Any help will be appreciated!
Ariel
Code:
forvalues i = 0 10 20 60 150 300 400 { forvalues j = 0 10 20 60 150 300 400 { regress y x if inlist(dose, `i', `j') } }
Comment