I am trying to do power calculations for the proportional odds model using the asypow library. The code noncenta90b10<-asypow.noncent(theta.ha=a9010,info.mat=infomatrixa90b10,constraints=constrt) returns Error in max(..., na.rm = na.rm) : invalid "mode" of argument. the various arguments I've used are: a9010 [,1] [1,] -1.7357568 [2,] -0.1928619 specifying the theta.ha array as a row not a column makes no difference> infomatrixa90b10[,1] [,2] [1,] 0.967005807 -0.004699262 [2,] -0.004699262 0.903852346> constrt[,1] [,2] [,3] [1,] "1" "a" "-1.92861865194525" [2,] "1" "b" "0" I'm probably missing something very simple, but I can't see what it is. Can anyone help? _______________________________________________________________________ Most doctors use http://www.Doctors.net.uk e-mail. Move to a free professional address with spam and virus protection.
david_foreman at doctors.org.uk wrote:> I am trying to do power calculations for the proportional odds model using the asypow library. > > The code > > noncenta90b10<-asypow.noncent(theta.ha=a9010,info.mat=infomatrixa90b10,constraints=constrt) > > returns > > Error in max(..., na.rm = na.rm) : invalid "mode" of argument. > > the various arguments I've used are: > a9010 > [,1] > [1,] -1.7357568 > [2,] -0.1928619 > specifying the theta.ha array as a row not a column makes no difference > > > >>infomatrixa90b10 > > [,1] [,2] > [1,] 0.967005807 -0.004699262 > [2,] -0.004699262 0.903852346 > > >>constrt > > [,1] [,2] [,3] > [1,] "1" "a" "-1.92861865194525" > [2,] "1" "b" "0" >I don't think you can specify a character matrix as constraints -- for sure the package maintainer knows better. Uwe Ligges> I'm probably missing something very simple, but I can't see what it is. Can anyone help? > > > _______________________________________________________________________ > Most doctors use http://www.Doctors.net.uk e-mail. > Move to a free professional address with spam and virus protection. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
david_foreman at doctors.org.uk wrote:>I am trying to do power calculations for the proportional odds model using the asypow library. > >The code > >noncenta90b10<-asypow.noncent(theta.ha=a9010,info.mat=infomatrixa90b10,constraints=constrt) > >returns > >Error in max(..., na.rm = na.rm) : invalid "mode" of argument. > >the various arguments I've used are: > a9010 > [,1] >[1,] -1.7357568 >[2,] -0.1928619 >specifying the theta.ha array as a row not a column makes no difference > > > > >>infomatrixa90b10 >> >> > [,1] [,2] >[1,] 0.967005807 -0.004699262 >[2,] -0.004699262 0.903852346 > > > >>constrt >> >> > [,1] [,2] [,3] >[1,] "1" "a" "-1.92861865194525" >[2,] "1" "b" "0" > > >I'm probably missing something very simple, but I can't see what it is. Can anyone help? > > >Problem is with your constarint matrix. From the help file (which admittedlt could be clearer) constrain is a 3-column matrix. First element in a row should be 1 to indicate a param set == to a value, 2 to indicate equality of two params. You put 1, so we assume first case. Second row element should be , in this case, index of param set to value, and cannot be "a" or "b". Lets suppose yours are first and second parameter, then it shoud be 1 and 2, respectively. Finally, in this case, third row element should be value. So you should use something like constrt <- matrix( c(1,1,-1.9286, 1,2,0), 2, 3, byrow=TRUE) and then, using your values for the other arguments, > asypow.noncent(a9010, infomatrix, constrt) $w [,1] [1,] 0.06993048 $df [1] 2 Kjetil -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra
Maybe Matching Threads
- Can't Get Lattice Histogram Minor Tick Marks to Work
- Can't Get Lattice Histogram Minor Tick Marks to Work
- Can't Get Lattice Histogram Minor Tick Marks to Work
- ncp t & Fortran error & power of some tests
- power and sample size for a GLM with Poisson response variable