On 17.08.2011 10:42, Danielle Martin wrote:> Hi,
>
> I would like to use the multinomRob function to test election results.
> However, depending on which independent variables I include and how many
> categories I have in the dependent variable, the model cannot be estimated.
>
> My data look like this (there are 68 observations):
>
>> head(database)
> RESTE09 GAUCHE09 PDC09 PLR09 UDC09 MCG09 RESTE05 GAUCHE05 PDC05
> D1 1455 5931 4726 7283 3611 5179 0.04487642 0.1707559 0.27561790
> D2 1736 10548 6905 27660 5430 5360 0.04487109 0.1797425 0.13782229
> D3 4208 12452 1721 8210 3179 8960 0.18580836 0.3218897 0.05659316
> D4 2182 9208 7288 10654 2951 5205 0.08227831 0.2591124 0.19605699
> D5 6129 13909 12691 15560 3129 12551 0.10438878 0.2362780 0.23772964
> D6 3027 13517 4702 17899 5299 5758 0.10507522 0.2034102 0.07564233
> PLR05 UDC05 MCG05 dim1 dim2 dim3
> D1 0.3006495 0.08555836 0.12254194 0.4327918 -0.37563170 0.23139759
> D2 0.4879385 0.09903729 0.05058832 1.2723817 0.03128996 -0.10629471
> D3 0.2296300 0.07822276 0.12785602 -0.8002237 -0.12194377 0.18147181
> D4 0.3051325 0.06789533 0.08952449 0.4321835 0.11445829 0.24636903
> D5 0.2811336 0.06624300 0.07422700 0.2560408 0.07019505 0.05611872
> D6 0.4186317 0.10281440 0.09442613 0.4487914 -0.15539599 -0.04779844
>
>
>
> I defined the model as follows:
>
>> mnr<-multinomRob(list(
> + GAUCHE09~GAUCHE05+dim1+dim2+dim3,
> + PDC09~PDC05+dim1+dim2+dim3,
> + PLR09~PLR05+dim1+dim2+dim3,
> + UDC09~UDC05+dim1+dim2+dim3,
> + MCG09~MCG05+dim1+dim2+dim3,
> + RESTE09~0),database,print.level=0)
>
>
> And the error message is:
>
> Error in multinomT.foo$se$beta : $ operator is invalid for atomic vectors
> In addition: There were 11 warnings (use warnings() to see them)
>
>> warnings()
> Warning messages:
> 1: In optim(param, fn = mt.dev, method = method, control = control, ... :
> unknown names in control: tol
> 2: In fn(par, ...) : value out of range in 'lgamma'
> 3: In fn(par, ...) : value out of range in 'lgamma'
> 4: In fn(par, ...) : value out of range in 'lgamma'
> 5: In fn(par, ...) : value out of range in 'lgamma'
> 6: In fn(par, ...) : value out of range in 'lgamma'
> 7: In fn(par, ...) : value out of range in 'lgamma'
> 8: In fn(par, ...) : value out of range in 'lgamma'
> 9: In fn(par, ...) : value out of range in 'lgamma'
> 10: In fn(par, ...) : value out of range in 'lgamma'
> 11: In fn(par, ...) : value out of range in 'lgamma'
>
>
> Is my model uncorrectly defined?
Don't know, but the optimizer evaluates the objective function in
regions of the space where lgamma() values cannot be represented by
double precision numbers any more.
Therefore you may want to introduce some constraints for the parameters
(without having loooked at the original problem).
Best,
Uwe Ligges
> many thanks,
>
> danielle martin
> graduate student
> department of political science
> university of michigan
>
> ______________________________________________
> 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.