Hi all,
I had a previous post attempting to get some assistance but I think I didn't provide enough informationhttp://www.statalist.org/forums/foru...on-comparisons.
Below is a series of proportional tests that I need to run.
My first question:
Can I run this code with fewer lines of code?
Second question:
Can I store the results from all prtest as new variables in a new data set?
At this point I know that a user written command svret (by Julian Reif) generates new variables with results but it only does that for one prtest at a time. Which would force me to save each result separately as a new data set and then have to append them all at the end. I am trying to be efficient (not succeeding thus far because I've spent two days trying to figure this out).
My aim afterwards is to use multproc (also a user written command by Roger Newson) to conduct adjusted multiple comparisons.
I had a previous post attempting to get some assistance but I think I didn't provide enough informationhttp://www.statalist.org/forums/foru...on-comparisons.
Below is a series of proportional tests that I need to run.
My first question:
Can I run this code with fewer lines of code?
Second question:
Can I store the results from all prtest as new variables in a new data set?
At this point I know that a user written command svret (by Julian Reif) generates new variables with results but it only does that for one prtest at a time. Which would force me to save each result separately as a new data set and then have to append them all at the end. I am trying to be efficient (not succeeding thus far because I've spent two days trying to figure this out).
My aim afterwards is to use multproc (also a user written command by Roger Newson) to conduct adjusted multiple comparisons.
Code:
prtest bmi_norm if (grade_hwa==0 | grade_hwa==1) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==0 | grade_hwa==2) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==0 | grade_hwa==3) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==0 | grade_hwa==4) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==0 | grade_hwa==5) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==0 | grade_hwa==6) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==1 | grade_hwa==2) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==1 | grade_hwa==3) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==1 | grade_hwa==4) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==1 | grade_hwa==5) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==1 | grade_hwa==6) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==2 | grade_hwa==3) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==2 | grade_hwa==4) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==2 | grade_hwa==5) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==2 | grade_hwa==6) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==3 | grade_hwa==4) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==3 | grade_hwa==5) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==3 | grade_hwa==6) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==4 | grade_hwa==5) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==4 | grade_hwa==6) & hwa==1 & half_year==2, by(grade_hwa) prtest bmi_norm if (grade_hwa==5 | grade_hwa==6) & hwa==1 & half_year==2, by(grade_hwa)