[R] How to extract values of results in gamlss.tr

David Winsemius dwinsemius at comcast.net
Wed Jan 23 21:42:39 CET 2013


On Jan 23, 2013, at 12:14 PM, Katherine Gobin wrote:

> Dear R helpers,
> 
> I have following loss data and I need to fit LEFT truncated Log Normal distribution to this data which is Truncated at 1000000.
> 
> dat = c(1333834,5710254,9987567,7809469,6940935,3473671,1270209,1102523,1124002, 5830159,4302300,3925242,2638409,2324421,7238436,9088709,7439250,4976551,4864319, 8741334,1863770,7098310,4942288,4971829,4986372)
> 
> library(gamlss.tr)
> 
> gen.trun(5, LOGNO)
> 
> result <- gamlss(dat~1, family=LOGNOtr)
> 
> 
> # THIS GIVES
> 
>> result
> 
> Family:  c("LOGNOtr", "left truncated Log Normal")
> 
> Fitting method: RS() 
> 
> Call:  gamlss(formula = dat ~ 1, family = LOGNOtr) 
> 
> Mu Coefficients:
> (Intercept)  
>       15.23  
> Sigma Coefficients:
> (Intercept)  
>     -0.3977  
> 
>  Degrees of Freedom for the fit: 2 Residual Deg. of Freedom   23 
> Global Deviance:     812.568 
>             AIC:     816.568 
>             SBC:     819.006 
> 
> My problem is how do I extract these values of Mu Coefficients and Sigma Coefficients, if I want to use these values for further analyses?

After looking at names(result)

> result$mu.coefficients
(Intercept) 
   15.23012 
> result$sigma.coefficients
(Intercept) 
 -0.3976947 

> help(gamlss.tr)

I looked for an extractor function in hte Index for htat package but didn't find one. Since this is a suite of packages you should probably do your own more extensive search in the documents.

-- 
David


David Winsemius
Alameda, CA, USA



More information about the R-help mailing list