Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gamlss Error in while (abs(G.dev.old - G.dev) > c.crit && iter < n.cyc)

Tags:

r

gamlss

I'v been working with this data

year rango_edad Sexo zona_2016 conteo siniestros expuestos upc_millon valor_millon freq 1 2010 01. < 1 F Alejada 180 87 75 121 111 0.48 2 2010 01. < 1 F Ciudades 103453 76219 40228 60755 84981 0.74 3 2010 01. < 1 F Especial 5129 3194 2078 3289 3013 0.62 4 2010 01. < 1 F Normal 27393 18436 10735 15656 16692 0.67 5 2010 01. < 1 M Alejada 185 98 73 116 110 0.53 6 2010 01. < 1 M Ciudades 106915 80731 41719 62991 105135 0.76 costo.medio ratio 1 1.27 0.92 2 1.11 1.40 3 0.94 0.92 4 0.91 1.07 5 1.12 0.94 6 1.30 1.67 and I'm trying to model the frequency with gamlss

gamlss(freq~Sexo+zona_2016+rango_edad,family=PO(mu.link = "log"),data=na.omit(subset(datos,is.na(freq)==FALSE ))) gamlss(freq~Sexo+zona_2016+rango_edad,family=NBI(mu.link = "log"),data=na.omit(subset(datos,is.na(freq)==FALSE )))

but I received this error message

Error in while (abs(G.dev.old - G.dev) > c.crit && iter < n.cyc) { : missing value where TRUE/FALSE needed

how can I solve that?

like image 493
bubleskmy Avatar asked Mar 28 '26 02:03

bubleskmy


1 Answers

The response variable is NOT a count but a frequency with values from 0 to 1. An appropriate model for this response (target) variable is the beta distribution. Please try family=BE.

like image 121
Mikis Stasinopoulos Avatar answered Mar 31 '26 06:03

Mikis Stasinopoulos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!