Re: [R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-12 Thread Wil M Contreras Arbaje

Thanks Bill!

Not asking for help with Stata at all, on the contrary: the article  
mentioned using Stata to fit the model described earlier, and I wasn't  
sure how to do the same in R (which is what I've used since college).


Thanks again, I'll play around a bit glmRob, see what happens (though  
it's slightly worrisome that I won't be able to obtain similar  
results, if only for 'contrast').


Cheers,


Wil




On Sep 12, 2010, at 12:36 AM, bill.venab...@csiro.au bill.venab...@csiro.au 
 wrote:


In R, the glm families poisson and quasipoisson will give you the  
same estimates.  Their standard errors will (usually) be different,  
though, and family = quasipoisson does not give you an AIC (since it  
does not maximise a true likelihood; it uses quasi-likelihood  
estimation).


I hope you are not asking this list for help with Stata. We've never  
heard of it.  It looks to me, though, that what you are doing below  
is fitting a robust poisson glm.  If so, it is something different  
again.  There is a package 'robust' which has a glmRob() fitting  
function in it that may do something similar, but there is so much  
tweaking allowed with robust fits the chance of getting the same  
result as with some other system (or even with R if you do it again,  
mostly) is effectively zero.


Tip: use R and forget the others.  It makes life so much easier all  
round.



-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org 
] On Behalf Of Wil M Contreras Arbaje

Sent: Sunday, 12 September 2010 11:27 AM
To: r-help@r-project.org
Subject: [R] R-equivalent Stata command: poisson or quasipoisson?

Hello R-help,

According to a research article that covers the topic I'm analyzing,
in Stata, a Poisson pseudo-maximum-likelihood (PPML) estimation can be
obtained with the command

poisson depvar_ij ln(indepvar1_ij) ln(indepvar2_ij) ...
ln(indepvarN_ij), robust

I looked up Stata help for the command, to understand syntax and such:

www.stata.com/help.cgi?poisson

Which simply says that the command fits a Poisson regression of depvar
on indepvars. However, in my google-searching, I noticed that pseudo-
maximum-likelihood estimation is sometimes called 'quasi-maximum,' and
that R has a quasipoisson family that seems to allow for
overdispersion. So, am I missing something, or should I specify
quasipoisson when implementing this estimation?

Thanks a lot!

Cheers,


Wil

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-12 Thread Ben Bolker
Wil M Contreras Arbaje wil.contreras at gmail.com writes:

 
 Thanks Bill!
 
 Not asking for help with Stata at all, on the contrary: the article  
 mentioned using Stata to fit the model described earlier, and I wasn't  
 sure how to do the same in R (which is what I've used since college).
 
 Thanks again, I'll play around a bit glmRob, see what happens (though  
 it's slightly worrisome that I won't be able to obtain similar  
 results, if only for 'contrast').
 
 Cheers,
 
 Wil


  I find it very hard to tell from Stata's help page, but my best guess
would be that the previously mentioned Stata command is more or less
equivalent to R's quasipoisson -- the 'robust' specification seems to
apply only to the standard error calculation, not to the fitting process.
What's unclear about 'robust' is that in other (least-squares fitting)
contexts in Stata, it means 'Huber-White sandwich estimators', i.e.
estimators that are robust to heteroscedasticity.  I suppose this is
more general (but also more data-hungry) than the simple expedient of
scaling the standard errors by a single estimated overdispersion parameter.

  The best thing, of course, would be to try a test case in both
systems.  Or it seems that
http://www.stata.com/bookstore/lrm.html (chapter 9) would be helpful.
(I checked the stata list archives for 'quasipoisson' and found only
a post from the author ...)

  Somewhat heretically, I prefer polycultures to monocultures; I like
R for many reasons, but I'm glad that there are other systems out there
with independent implementations and different sets of advantages
and drawbacks.

 
 On Sep 12, 2010, at 12:36 AM, Bill.Venables at csiro.au Bill.Venables
at csiro.au 
   wrote:
 
  In R, the glm families poisson and quasipoisson will give you the  
  same estimates.  Their standard errors will (usually) be different,  
  though, and family = quasipoisson does not give you an AIC (since it  
  does not maximise a true likelihood; it uses quasi-likelihood  
  estimation).
 
  I hope you are not asking this list for help with Stata. We've never  
  heard of it.  It looks to me, though, that what you are doing below  
  is fitting a robust poisson glm.  If so, it is something different  
  again.  There is a package 'robust' which has a glmRob() fitting  
  function in it that may do something similar, but there is so much  
  tweaking allowed with robust fits the chance of getting the same  
  result as with some other system (or even with R if you do it again,  
  mostly) is effectively zero.
 
  Tip: use R and forget the others.  It makes life so much easier all  
  round.
 
 
  -Original Message-
  From: r-help-bounces at r-project.org [mailto:r-help-bounces at
r-project.org 
  ] On Behalf Of Wil M Contreras Arbaje
  Sent: Sunday, 12 September 2010 11:27 AM
  To: r-help at r-project.org
  Subject: [R] R-equivalent Stata command: poisson or quasipoisson?
 
  Hello R-help,
 
  According to a research article that covers the topic I'm analyzing,
  in Stata, a Poisson pseudo-maximum-likelihood (PPML) estimation can be
  obtained with the command
 
  poisson depvar_ij ln(indepvar1_ij) ln(indepvar2_ij) ...
  ln(indepvarN_ij), robust
 
  I looked up Stata help for the command, to understand syntax and such:
 
  www.stata.com/help.cgi?poisson
 
  Which simply says that the command fits a Poisson regression of depvar
  on indepvars. However, in my google-searching, I noticed that pseudo-
  maximum-likelihood estimation is sometimes called 'quasi-maximum,' and
  that R has a quasipoisson family that seems to allow for
  overdispersion. So, am I missing something, or should I specify
  quasipoisson when implementing this estimation?
 
  Thanks a lot!
 
  Cheers,
 
 
  Wil
 
  __
  R-help at r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-12 Thread Wil M Contreras Arbaje

Thank you Ben,

From the article, the purpose of the author's methodology is to  
better handle heteroskedasticity (due, in part, to Jensen's  
inequality). Either way, I'll try both, and see how they compare, as  
I'd like the R estimation to match the Stata one.


Thanks again for your insight,

Cheers,


Wil

On Sep 12, 2010, at 12:58 PM, Ben Bolker wrote:


Wil M Contreras Arbaje wil.contreras at gmail.com writes:



Thanks Bill!

Not asking for help with Stata at all, on the contrary: the article
mentioned using Stata to fit the model described earlier, and I  
wasn't

sure how to do the same in R (which is what I've used since college).

Thanks again, I'll play around a bit glmRob, see what happens (though
it's slightly worrisome that I won't be able to obtain similar
results, if only for 'contrast').

Cheers,

Wil



 I find it very hard to tell from Stata's help page, but my best guess
would be that the previously mentioned Stata command is more or less
equivalent to R's quasipoisson -- the 'robust' specification seems to
apply only to the standard error calculation, not to the fitting  
process.

What's unclear about 'robust' is that in other (least-squares fitting)
contexts in Stata, it means 'Huber-White sandwich estimators', i.e.
estimators that are robust to heteroscedasticity.  I suppose this is
more general (but also more data-hungry) than the simple expedient of
scaling the standard errors by a single estimated overdispersion  
parameter.


 The best thing, of course, would be to try a test case in both
systems.  Or it seems that
http://www.stata.com/bookstore/lrm.html (chapter 9) would be helpful.
(I checked the stata list archives for 'quasipoisson' and found only
a post from the author ...)

 Somewhat heretically, I prefer polycultures to monocultures; I like
R for many reasons, but I'm glad that there are other systems out  
there

with independent implementations and different sets of advantages
and drawbacks.



On Sep 12, 2010, at 12:36 AM, Bill.Venables at csiro.au  
Bill.Venables

at csiro.au

wrote:



In R, the glm families poisson and quasipoisson will give you the
same estimates.  Their standard errors will (usually) be different,
though, and family = quasipoisson does not give you an AIC (since it
does not maximise a true likelihood; it uses quasi-likelihood
estimation).

I hope you are not asking this list for help with Stata. We've never
heard of it.  It looks to me, though, that what you are doing below
is fitting a robust poisson glm.  If so, it is something different
again.  There is a package 'robust' which has a glmRob() fitting
function in it that may do something similar, but there is so much
tweaking allowed with robust fits the chance of getting the same
result as with some other system (or even with R if you do it again,
mostly) is effectively zero.

Tip: use R and forget the others.  It makes life so much easier all
round.


-Original Message-
From: r-help-bounces at r-project.org [mailto:r-help-bounces at

r-project.org

] On Behalf Of Wil M Contreras Arbaje
Sent: Sunday, 12 September 2010 11:27 AM
To: r-help at r-project.org
Subject: [R] R-equivalent Stata command: poisson or quasipoisson?

Hello R-help,

According to a research article that covers the topic I'm analyzing,
in Stata, a Poisson pseudo-maximum-likelihood (PPML) estimation  
can be

obtained with the command

poisson depvar_ij ln(indepvar1_ij) ln(indepvar2_ij) ...
ln(indepvarN_ij), robust

I looked up Stata help for the command, to understand syntax and  
such:


www.stata.com/help.cgi?poisson

Which simply says that the command fits a Poisson regression of  
depvar
on indepvars. However, in my google-searching, I noticed that  
pseudo-
maximum-likelihood estimation is sometimes called 'quasi-maximum,'  
and

that R has a quasipoisson family that seems to allow for
overdispersion. So, am I missing something, or should I specify
quasipoisson when implementing this estimation?

Thanks a lot!

Cheers,


Wil

__
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-11 Thread Wil M Contreras Arbaje

Hello R-help,

According to a research article that covers the topic I'm analyzing,  
in Stata, a Poisson pseudo-maximum-likelihood (PPML) estimation can be  
obtained with the command


	poisson depvar_ij ln(indepvar1_ij) ln(indepvar2_ij) ...  
ln(indepvarN_ij), robust


I looked up Stata help for the command, to understand syntax and such:

www.stata.com/help.cgi?poisson

Which simply says that the command fits a Poisson regression of depvar  
on indepvars. However, in my google-searching, I noticed that pseudo- 
maximum-likelihood estimation is sometimes called 'quasi-maximum,' and  
that R has a quasipoisson family that seems to allow for  
overdispersion. So, am I missing something, or should I specify  
quasipoisson when implementing this estimation?


Thanks a lot!

Cheers,


Wil

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-11 Thread Bill.Venables
In R, the glm families poisson and quasipoisson will give you the same 
estimates.  Their standard errors will (usually) be different, though, and 
family = quasipoisson does not give you an AIC (since it does not maximise a 
true likelihood; it uses quasi-likelihood estimation).

I hope you are not asking this list for help with Stata. We've never heard of 
it.  It looks to me, though, that what you are doing below is fitting a robust 
poisson glm.  If so, it is something different again.  There is a package 
'robust' which has a glmRob() fitting function in it that may do something 
similar, but there is so much tweaking allowed with robust fits the chance of 
getting the same result as with some other system (or even with R if you do it 
again, mostly) is effectively zero.

Tip: use R and forget the others.  It makes life so much easier all round. 
 

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Wil M Contreras Arbaje
Sent: Sunday, 12 September 2010 11:27 AM
To: r-help@r-project.org
Subject: [R] R-equivalent Stata command: poisson or quasipoisson?

Hello R-help,

According to a research article that covers the topic I'm analyzing,  
in Stata, a Poisson pseudo-maximum-likelihood (PPML) estimation can be  
obtained with the command

poisson depvar_ij ln(indepvar1_ij) ln(indepvar2_ij) ...  
ln(indepvarN_ij), robust

I looked up Stata help for the command, to understand syntax and such:

www.stata.com/help.cgi?poisson

Which simply says that the command fits a Poisson regression of depvar  
on indepvars. However, in my google-searching, I noticed that pseudo- 
maximum-likelihood estimation is sometimes called 'quasi-maximum,' and  
that R has a quasipoisson family that seems to allow for  
overdispersion. So, am I missing something, or should I specify  
quasipoisson when implementing this estimation?

Thanks a lot!

Cheers,


Wil

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.