Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
--------------------------------------------------------------------------------
Instead of:
... i.agencytype bps i.agencytype#i.bps ...
Try:
... i.agencytype i.bps i.agencytype#i.bps ...
(so that bps is always modelled as a factor variable; in your original syntax it's modelled once as a continuous variable and once as a factor variable)
Slightly more efficient is:
... i.agencytype##i.bps ...
Phil
On 21/11/2012, at 9:52 AM, Simone Peart Boyce <[email protected]> wrote:
> Hi,
>
> I am running a regression with interacted factors and would like to specify the factors to use as the base. I do the following, but it seems only to work when the factor is not interacted.
>
> fvset base 1 agencytype
> xtgee breast i.agencytype bps i.agencytype#i.bps, family(binomial) link(logit) corr(exc) vce(robust)
>
> The output as below omits agencytype=6 when interacted with BPS rather than agencytype=1. How do I get Stata to omit agencytype 1 instead?
>
> Thanks in advance,
> Simone
>
>
> note: 2.agencytype#1.BPS identifies no observations in the sample
> note: 6.agencytype#1.BPS omitted because of collinearity
> Iteration 1: tolerance = .02508496
> Iteration 2: tolerance = .00012234
> Iteration 3: tolerance = 4.649e-07
> GEE population-averaged model Number of obs = 16426
> Group variable: patient_id Number of groups = 14253
> Link: logit Obs per group: min = 1
> Family: binomial avg = 1.2
> Correlation: exchangeable max = 6
> Wald chi2(10) = 220.51
> Scale parameter: 1 Prob > chi2 = 0.0000
> (Std. Err. adjusted for clustering on patient_id)
> --------------------------------------------------------------------------------
> | Robust
> breast_compl~r | Coef. Std. Err. z P>|z| [95% Conf. Interval]
> ---------------+----------------------------------------------------------------
> agencytype |
> 1 | 0 (base)
> 2 | -.3476051 .4017287 -0.87 0.387 -1.134979 .4397687
> 3 | .6622408 .1231947 5.38 0.000 .4207837 .9036979
> 4 | .303693 .3774096 0.80 0.421 -.4360163 1.043402
> 5 | .4469481 .1493272 2.99 0.003 .1542722 .7396241
> 6 | -.2703296 .1281538 -2.11 0.035 -.5215065 -.0191527
> |
> BPS | .2035705 .1517018 1.34 0.180 -.0937596 .5009006
> |
> agencytype#BPS |
> 1 1 | .6664529 .1794499 3.71 0.000 .3147376 1.018168
> 2 1 | 0 (empty)
> 3 1 | .77403 .2479991 3.12 0.002 .2879608 1.260099
> 4 1 | .8264168 .5002503 1.65 0.099 -.1540558 1.806889
> 5 1 | .1369255 .2521904 0.54 0.587 -.3573586 .6312096
> 6 1 | 0 (omitted)
> |
> _cons | 2.319875 .0603756 38.42 0.000 2.201541 2.438209
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/