[R] Clogit R and Stata

peter dalgaard pdalgd at gmail.com
Fri Jun 7 17:12:30 CEST 2013

On Jun 7, 2013, at 15:34 , Richard Beckett wrote:

> Sorry to once again write a message but I'm once again stumped and am having no luck finding a solution anywhere else.
> This question requires some finesse in both R and STATA so hopefully I will be able to get an answer here. I am much more adept in R and am trying to replicate the results of a STATA file in R. Hopefully this is a proper forum for such questions. 
> This is the code for the clogit in STATA
> clogit sftpcons sftptv2a3 sftptv2a4 sftptv2a5 sftptv2a2 sftptv2a6 logim maccat disp4cat if sample==1 & glb_ind=="Y", group(stratida)
> and I tried to replicate it using
> clogit1<-clogit(sftpcons~sftptv2a3+sftptv2a4+sftptv2a5+sftptv2a2+sftptv2a6+logim+maccat+disp4cat+strata(stratida), dframe, sample==1 | glb_ind=="Y")
> but got different results
> What did I do wrong here? I interpreted the STATA clogit as run this logit as long as the sample is 1 and glb_ind="Y" What should I be doing instead?

An "&" rather than "|" in the R version might help. Other than that, we're a bit short on clues unless you provide some output.

Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com

More information about the R-help mailing list