I am fairly new to Stata.
I have survival data for 60 patients. I have asked a large number of physicians to evaluate each of the patients and say whether they think the patient has a killer disease - so, a binary evaluation of 1 = yes, has the disease, 0 = no, does not have the disease. Each doctor is labeled var1.....varN). Here is what the data looks like for the first 10 patients and for 3 doctors (var1-var3):
I can easily perform a stcox var1 to see the prognostic significance of the doctor's ( in this case, labeled var1) diagnosis. The issue is, that I may have up to 1000 doctors which makes performing a stcox for each very cumbersome. Ideally I could write the results to another file. This what I have tried - posting the result to another file called test.dta.
I can see at least one reason why this doesn't work - I think that the line
Isn't specifying one value but instead a set of results. The ideal situation would be to "post" the HR, p value and CI to another file. That file would look like this:
I am sure there is an easy way to do this. May I ask for some assistance?
I have survival data for 60 patients. I have asked a large number of physicians to evaluate each of the patients and say whether they think the patient has a killer disease - so, a binary evaluation of 1 = yes, has the disease, 0 = no, does not have the disease. Each doctor is labeled var1.....varN). Here is what the data looks like for the first 10 patients and for 3 doctors (var1-var3):
Code:
input byte(patient dead var1 var2 var3) 1 0 0 0 0 2 0 0 0 0 3 0 1 1 1 4 1 0 0 0 5 1 0 1 1 6 0 0 0 0 7 1 1 1 1 8 1 0 0 0 9 1 0 0 0 10 1 0 0 1 end
Code:
tempname memhold postfile `memhold' survival using "test.dta" , replace foreach var in varlist var1-var10 { post `memhold' (`stcox(var)') } postclose `memhold'
Code:
post ` memhold ' (` stcox (var)')
Code:
doctor hr p CIlwr CIupper "var1" 4.341 .003 1.672851 11.26876 "var2" 2.595 .031 1.092362 6.165455 "var3" 6.160 0 2.430396 15.61521
Comment