SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: Pseudo R^2 values for CensReg models [ Reply ]
By: Arne Henningsen on 2018-04-09 06:20
[forum:45832]
The censReg package cannot be built at R-Forge right now, because censReg uses function "ghq" of the "glmmML" package and this package currently unavailable at R-Froge (I don't know why). You (or anybody else) can anyway get the latest version of the censReg package by "checking out" the latest version of the censReg package from the SVN repository (folder /pkg/censReg/, see https://r-forge.r-project.org/scm/?group_id=256). Alternatively, you (or anybody else) can send me e-mail with information about your operating system and then I will send you the source package (.tar.gz) or the MS-Windows binary (.zip).


RE: Pseudo R^2 values for CensReg models [ Reply ]
By: E Hunt on 2018-04-04 23:09
[forum:45815]
Thank you for investigating this further and finding a fix! I followed the R-forge link provided and it says rev 1910, not 1953? Downloaded and problem still exists so I figure I'm still on the old version.

It would be great to include calculation of McFadden pseudo R^2 in e.g. the summary function.

RE: Pseudo R^2 values for CensReg models [ Reply ]
By: Arne Henningsen on 2018-04-04 06:53
[forum:45806]
Thanks a lot for the clarification! I can reproduce the error with panel data. I found out that the error occurred in the estimation of the model by plm() that is conducted in order to obtain starting values for the maximum likelihood estimation and that plm() cannot estimate models with intercept only. I fixed this in the censReg version at R-Forge (revision 1953). This version obtains starting values in a different (simpler) way if the model has only an intercept (and no (other) explanatory variables). Please install the censReg package from R-Forge (e.g., via [1], but not before revision 1953 is included in the package) and check whether everything works as expected with your models and data. If you do not experience any problems with the censReg version at R-Forge, I will update the version at CRAN accordingly. Should we (together) implement the calculation of the Pseudo R^2 value (before I update the package at CRAN)?

[1] https://r-forge.r-project.org/R/?group_id=256

RE: Pseudo R^2 values for CensReg models [ Reply ]
By: E Hunt on 2018-03-30 10:23
[forum:45803]
Thanks for the reply

Would this work for panel data (ie multiple observations over time of the same individuals)? My error now is

Error in plm.fit(object, data, model = "within", effect = effect) :
empty model

RE: Pseudo R^2 values for CensReg models [ Reply ]
By: Arne Henningsen on 2018-03-30 07:59
[forum:45800]
Thank you for suggesting to add a feature that calculates McFadden's pseudo-R2!

Can you please provide a minimal reproducible example that reproduces the error?

The following example without explanatory variables (except for the intercept) works without problems on my computer:
> data( "Affairs", package = "AER" )
> estResult <- censReg( affairs ~ 1, data = Affairs )


RE: Pseudo R^2 values for CensReg models [ Reply ]
By: E Hunt on 2018-03-06 15:17
[forum:45742]
Phrasing the question differently, I see that one can calculate McFadden's pseudo-R2 using = 1 − L1/L0
where L0 and L1 are the constant-only and full model log-likelihoods, respectively.
So how does one obtain the 'constant only' model L0?

I get the below error trying to use a formula DV ~ 1

Error in uniqval[as.character(effect), , drop = F] :
incorrect number of dimensions

Pseudo R^2 values for CensReg models [ Reply ]
By: E Hunt on 2018-03-02 21:58
[forum:45719]
Hello,

Is there a straightforward way to obtain pseudo R-squared values for censReg models? e.g. the McFadden, or McKelvey & Zavoina value?
If you can provide a function, or some brief R code to do this, that'd be much appreciated (need for paper revisions)

Thanks to:
Vienna University of Economics and Business Powered By FusionForge