Dear R users, I'm trying to do betareg on my dataset. Dependent variable is not normally distributed and is proportion (of condom use (0,1)). But I'm having problems: gyl<-betareg(cond ~ alcoh + drug, data=results) Error in optim(par = start, fn = loglikfun, gr = gradfun, method = method, : initial value in 'vmmin' is not finite Why is R returning me error in optim()? What should I do? In advance, thank you for advice! -- ************************** Vlatka Matkovic Puljic +32/ 485/ 453340 [[alternative HTML version deleted]]
On Sat, 12 Mar 2011, Vlatka Matkovic Puljic wrote:> Dear R users, > > I'm trying to do betareg on my dataset. > Dependent variable is not normally distributed and is proportion (of condom > use (0,1)). > But I'm having problems: > > gyl<-betareg(cond ~ alcoh + drug, data=results) > Error in optim(par = start, fn = loglikfun, gr = gradfun, method = method, : > > initial value in 'vmmin' is not finite > > Why is R returning me error in optim()?Hard to say with the information you provide...> What should I do?You can try to do the usual things when numerically optimizing nonlinear models: (1) Check whether the data is degenerate in some way, e.g., not enough variation in the response for combinations of the predictors. (2) Check whether the scaling of your regressors is ok. Maybe standardizing them to a numerically more stable scale is useful. (3) Provide better starting values than the defaults. hth, Z> In advance, thank you for advice! > > > > > -- > ************************** > Vlatka Matkovic Puljic > +32/ 485/ 453340 > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >
Maybe I should include data: results$cond [1] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 [13] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 [25] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 [37] 0.001 0.001 0.020 0.020 0.020 0.030 0.030 0.050 0.050 0.050 0.050 0.050 [49] 0.050 0.050 0.050 0.050 0.060 0.060 0.060 0.070 0.070 0.070 0.070 0.080 [61] 0.090 0.100 0.100 0.100 0.100 0.100 0.100 0.120 0.120 0.130 0.130 0.140 [73] 0.160 0.160 0.170 0.170 0.180 0.180 0.200 0.200 0.210 0.210 0.210 0.220 [85] 0.230 0.250 0.250 0.250 0.250 0.270 0.280 0.300 0.300 0.300 0.300 0.300 [97] 0.310 0.320 0.330 0.340 0.350 0.350 0.350 0.360 0.400 0.430 0.430 0.450 [109] 0.450 0.450 0.450 0.450 0.450 0.450 0.450 0.450 0.450 0.460 0.470 0.470 [121] 0.470 0.470 0.480 0.490 0.490 0.500 0.500 0.500 0.500 0.500 0.500 0.500 [133] 0.500 0.500 0.500 0.520 0.530 0.550 0.550 0.550 0.560 0.600 0.600 0.600 [145] 0.600 0.600 0.620 0.640 0.650 0.650 0.650 0.650 0.660 0.680 0.680 0.680 [157] 0.680 0.700 0.700 0.700 0.700 0.700 0.700 0.710 0.740 0.750 0.750 0.750 [169] 0.750 0.760 0.760 0.770 0.780 0.800 0.800 0.800 0.800 0.800 0.810 0.820 [181] 0.820 0.830 0.830 0.840 0.850 0.850 0.850 0.850 0.860 0.870 0.870 0.870 [193] 0.900 0.900 0.900 0.900 0.900 0.910 0.920 0.920 0.930 0.930 0.950 0.950 [205] 0.950 0.960 0.980 0.980 0.999 2011/3/12 Vlatka Matkovic Puljic <v.matkovic.puljic@gmail.com>> Dear R users, > > I'm trying to do betareg on my dataset. > Dependent variable is not normally distributed and is proportion (of condom > use (0,1)). > But I'm having problems: > > gyl<-betareg(cond ~ alcoh + drug, data=results) > Error in optim(par = start, fn = loglikfun, gr = gradfun, method = method, > : > initial value in 'vmmin' is not finite > > Why is R returning me error in optim()? > What should I do? > > In advance, thank you for advice! > > > > > -- > ************************** > Vlatka Matkovic Puljic > +32/ 485/ 453340 > >-- ************************** Vlatka Matkovic Puljic +32/ 485/ 453340 [[alternative HTML version deleted]]
http://dl.dropbox.com/u/21595123/Book1.csv 2011/3/13 David Winsemius <dwinsemius@comcast.net>> Nothing came through. You need to read the posting guide. > > > On Mar 13, 2011, at 12:59 PM, Vlatka Matkovic Puljic wrote: > > Sorry, here is my data (attached). >> >> 2011/3/12 Ben Bolker <bbolker@gmail.com> >> >> Vlatka Matkovic Puljic <v.matkovic.puljic <at> gmail.com> writes: >>> >>> >>>> That was also my first thought. >>>> But I guess it has something to do with W and phihat >>>> (which I'm struggling to check >>>> >>> >>> Again, it would help to post a reproducible example ... >>> hard to debug/diagnose by remote control. If you can't >>> possibly post the data to the list, or put them on a web >>> site somewhere, or randomize them a bit so you're not >>> giving anything away, or find a simulated example that >>> shows the same problem, you could as a last resort send them >>> to me. >>> >>> Ben Bolker >>> >> >> > > David Winsemius, MD > West Hartford, CT > >-- ************************** Vlatka Matkovic Puljic +32/ 485/ 453340 [[alternative HTML version deleted]]