[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Kieran McCaul" <Kieran.McCaul@uwa.edu.au> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: log binomial regression - categorical independent variables |

Date |
Fri, 21 Aug 2009 08:41:31 +0800 |

... The -glm- command you have used is: xi:glm IOTFnew highested_2 i.highested_2*IOTFnew, family(binomial) link(log) eform If this is indeed the syntax you have used, then there are a couple of obvious problems. 1. The dependent variable is IOTFnew, but this also appears as an independent variable. 2. The independent variable, highested_2, is entered both as a continuous variable and as a categorical variable, i.highested_2. So I would suggest you try: xi:glm IOTFnew i.highested_2, family(binomial) link(log) eform ______________________________________________ Kieran McCaul MPH PhD WA Centre for Health & Ageing (M573) University of Western Australia Level 6, Ainslie House 48 Murray St Perth 6000 Phone: (08) 9224-2701 Fax: (08) 9224 8009 email: Kieran.McCaul@uwa.edu.au http://myprofile.cos.com/mccaul http://www.researcherid.com/rid/B-8751-2008 ______________________________________________ If you live to be one hundred, you've got it made. Very few people die past that age - George Burns -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Amy Jennings Sent: Thursday, 20 August 2009 9:43 PM To: statalist@hsphsun2.harvard.edu Subject: RE: st: log binomial regression - categorical independent variables Hi, Many thanks for your reply it was greatly appreciated- I have tried your suggestion but it does not seem to be working. This if the syntax I have used: xi:glm IOTFnew highested_2 i.highested_2*IOTFnew, family(binomial) link(log) eform IOTFnew is the dependent variable (child weight status - 2 categories) and highested_2 the independent (4 categories) and below is the response I am getting i.highested_2 _Ihighested_1-4 (naturally coded; _Ihighested_1 omitted) i.high~2*IOTF~w _IhigXIOTFn_# (coded as above) note: _Ihighested_4 dropped because of collinearity Iteration 0: log likelihood = -130.92025 (not concave) Iteration 1: log likelihood = -130.92025 (not concave) Iteration 2: log likelihood = -130.92025 (not concave) Iteration 3: log likelihood = -130.92025 (not concave) Iteration 4: log likelihood = -130.92025 (not concave) Iteration 5: log likelihood = -130.92025 (not concave) Iteration 6: log likelihood = -130.92025 (not concave) Iteration 7: log likelihood = -130.92025 (not concave) Iteration 8: log likelihood = -130.92025 (not concave) Iteration 9: log likelihood = -130.92025 (not concave) Not sure where I am going wrong? I have tried a few variations but don't seem to be getting very far, Many thanks again, kind regards, Amy ---------------------------------------- > Date: Thu, 20 Aug 2009 15:00:33 +0200 > From: evans.jadotte@uab.es > Subject: Re: st: log binomial regression - categorical independent variables > To: statalist@hsphsun2.harvard.edu > > Amy Jennings wrote: >> Hi >> >> I am currently using stata to estimate prevalence ratios (or risk ratios as I think stata refers to them) using log binomial regression with the glm function. I am using the syntax >> >> glm dependent independent, family(binomial) link(log) eform >> >> this has worked fine but I would now like to add a categorical independent variable with more than two categories, and obtain coefficients for each of the categories, e.g. I am trying to calculate prevalence ratios for childhood overweight compared with normal weight for increasing category of parental education, is it possible to estimate prevalence ratios for children whose parents are educated to school-level or university-level verses those with no education? >> >> Many thanks in advance, >> _________________________________________________________________ >> Windows Live Messenger: Happy 10-Year Anniversary-get free winks and emoticons. >> http://clk.atdmt.com/UKM/go/157562755/direct/01/ >> * >> * For searches and help try: >> * http://www.stata.com/help.cgi?search >> * http://www.stata.com/support/statalist/faq >> * http://www.ats.ucla.edu/stat/stata/ >> > Hi, > > Maybe what you want is: > > xi:glm dependent independent... i.schooling*overweight, family(binomial) link(log) eform > > Schooling is assumed to have various categories and stata will keep the first one as reference. You can however control which one is used as a reference group. > > Hope this helps, > > Evans > > > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ _________________________________________________________________ Upgrade to Internet Explorer 8 Optimised for MSN. http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/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/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: log binomial regression - categorical independent variables***From:*Amy Jennings <amyjennings79@hotmail.com>

**Re: st: log binomial regression - categorical independent variables***From:*Evans Jadotte <evans.jadotte@uab.es>

**RE: st: log binomial regression - categorical independent variables***From:*Amy Jennings <amyjennings79@hotmail.com>

- Prev by Date:
**Re: st: Printing help viewer or log files on a single 8.5 x 11 page** - Next by Date:
**RE: st: Debugging tool** - Previous by thread:
**RE: st: log binomial regression - categorical independent variables** - Next by thread:
**st: Clustered robust standard errors in simultaneous equations system** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |