Originally posted by Andrew Musau
View Post
Your code has worked but when I try to replacing some of your code with mine in the hope of achieving the same results I get an error. See code below:
Code:
. qui stset date_of_nextapp, fail(ltfup_status) id(artnumber) origin(art_start_date) enter(art_start_date) scale(365.25) . preserve . qui log using firstfile, name(log1) text replace . stmh age_at_artstart2, c(2,1) failure _d: ltfup_status analysis time _t: (date_of_nextapp-origin)/365.25 origin: time art_start_date enter on or after: time art_start_date id: artnumber Maximum likelihood estimate of the rate ratio comparing age_at_artstart2==2 vs. age_at_artstart2==1 RR estimate, and lower and upper 95% confidence limits ---------------------------------------------------------- RR chi2 P>chi2 [95% Conf. Interval] ---------------------------------------------------------- 2.041 143.33 0.0000 1.812 2.300 ---------------------------------------------------------- . log close log1 name: log1 log: C:\Users\Paul.Somwe\Documents\Tx abstract\firstfile.log log type: text closed on: 7 Jul 2020, 14:20:38 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- . insheet using "firstfile.log", clear (3 vars, 19 obs) . gen obs=_n . qui sum obs if regexm(v1, "P>chi2") v1 not found r(111);
Paul
Comment