Good morning, I am using R to try to model the proportion of burned area in Portugal. The dependent variable is the proportion. The family used is binomial and the epsilon would be binary. I am not able to find the package to be used when the proportion (%) has to be used in glm. Could someone help me? I am using normal commands of glm.. for example: glm_5<- glm(formula=p~Precipitation, family=binomial(link=logit), data=dados) where p is the proportion of burned area, but this error message apperars: Warning message: non-integer #successes in a binomial glm! in: eval(expr, envir, enclos) That is why I think I am not using the proper glm package. Thank you very much in advance. Jordi -- ______________________________________________________________________ Jordi Garcia-Gonzalo FORCHANGE - Forest Ecosystem Management Under Global Change Departamento de Engenharia Florestal - Instituto Superior de Agronomia Universidade T?cnica de Lisboa Tapada da Ajuda, 1349-017 Lisboa Portugal tel: +351 21 365 33 66 fax: +351 21 364 50 00 email:Jordigarcia at isa.utl.pt
Jordi Garcia wrote:> Good morning, > > I am using R to try to model the proportion of burned area in > Portugal. The dependent variable is the proportion. The family used is > binomial and the epsilon would be binary. > > I am not able to find the package to be used when the proportion (%) > has to be used in glm. Could someone help me? > > I am using normal commands of glm.. for example: > > glm_5<- glm(formula=p~Precipitation, family=binomial(link=logit), > data=dados) > > where p is the proportion of burned area, but this error message > apperars: > > Warning message: > non-integer #successes in a binomial glm! in: eval(expr, envir, enclos) > > That is why I think I am not using the proper glm package. > > Thank you very much in advance. > > JordiJordi, Your statistical model is wrong. The binomial family if four counts data (counts of successes given n trials), not for proportions. To model proportions, your family is the Beta family. I've modeled proportion response variables with function betareg of package betareg. If you want my example applications I can send you code and data off list. Reference: Ferrari and Cribari-Neto. 2004. Beta regression for modelling rates and proportions. Journal of Applied Statistics 31:799-815. Rub?n
Good morning, I am using R to try to model the proportion of burned area in Portugal. The dependent variable is the proportion (P). The family used is binomial and the epsilon would be binary. They have recommended me to use the Betareg package as it allows to work with proportions. When I use the Betareg function for my data (2800 lines) with 7 variavels. I created a model using the sum of all seven variables and using p (proportion of area burnt as the independent variable). I obtained these results, can you tell me if this is normal? or what do the errors mean? Thank you in advance. Is there any limit in the number of lines and variables(columns) to use? This was the functions used and the results obtained: >attach(dados) mod9 <- betareg(P ~ Fuel+Temperature+Slope+Altitude+Precipitation+Roadsproximity+Population, data=dados) Warning messages: 1: NaNs produced in: sqrt(W) 2: NaNs produced in: sqrt(W) 3: NaNs produced in: sqrt(1 + phihat) > summary(mod9) Call: betareg(formula = P ~ Fuel + Temperature + Slope + Altitude + Precipitation + Roadsproximity + Population, data = dados) Deviance Residuals: Min. 1st Qu. Median 3rd 0 0 0 0 0 Coefficients: Estimate Std.Error z-value Pr(>|z|) (Intercept) -83062.5 9.34E-02 -8.89E+05 0 FuelAnnualCrop -2256.8 2.31E-01 -9.78E+03 0 FuelHard -8179.8 7.95E-02 -1.03E+05 0 FuelHardSoftEuc -4449.7 7.02E-02 -6.34E+04 0 FuelNoFuel -9552.1 9.02E-02 -1.06E+05 0 FuelPermCrop -5112.5 8.39E-02 -6.10E+04 0 FuelShrubs -8246 7.32E-02 -1.13E+05 0 FuelSoft -11795.1 7.51E-02 -1.57E+05 0 FuelSoftEuc -1561.8 7.67E-02 -2.04E+04 0 Temperature -1.3E+07 7.14E-04 -1.80E+10 0 Slope 78122.8 3.78E-03 2.07E+07 0 Altitude 1143023 7.19E-05 1.59E+10 0 Precipitation -1482288 2.11E-03 -7.03E+08 0 RoadsproximityDistRd>1Km -45315.1 3.82E-02 -1.19E+06 0 Population 4711684 2.81E-04 1.68E+10 0 Estimated precision parameter (phi): -560353.4 with s.e. 315.9113 Null Deviance: 0 on 2818 degrees of freedom Residual Deviance: 0 on 2804 degrees of freedom Log-Likelihood Ratio Statistic: 3291846935 on 14 degrees of freedom Pseudo R^2: 0.07753642 AIC: -3291849573 Warning messages: 1: NaNs produced in: sqrt(muhat * (1 - muhat)/(1 + phihat)) 2: NaNs produced in: sqrt(muhat * (1 - muhat)/(1 + phihat)) Thank you very much in advance, Jordi>-- ______________________________________________________________________ Jordi Garcia-Gonzalo FORCHANGE - Forest Ecosystem Management Under Global Change Departamento de Engenharia Florestal - Instituto Superior de Agronomia Universidade Técnica de Lisboa Tapada da Ajuda, 1349-017 Lisboa Portugal tel: +351 21 365 33 66 fax: +351 21 364 50 00 email:Jordigarcia@isa.utl.pt [[alternative HTML version deleted]]