Skip to content
Prev 74833 / 398502 Next

Loop problem

1) You need to simplify your codes a bit and show people how the input
might look like if you want useful responses. Perhaps a small
reproducible example or brief description of what you are trying to do
might help. See the posting guide for more details.


2) I am guessing here but are you interested in multinomial logistic
regression ? If so, searching the R-help suggests glm with
family="binomial", multinom in nnet package and
http://www.stat.auckland.ac.nz/~yee/VGAM/ . Remember that you may need
'Tr' to be a factor.


3) You should avoid writing functions that depend on global variables as
they may change. If you really need your MLE function, here is an
(untested) way to rewrite it such that it requires explicit inputs. 

  my.MLE <- function (x, mu, v){

    n <- length( x )
    tmp <- n*log(2*pi) + n*log(v) + sum( ( x - mu )^2 ) / v
    return( 0.5*tmp )

  }

and you call it with

   my.MLE( x=logitTr1$logitp, mu=p, v=logitTr1$sd^2 )


Regards, Adai
On Tue, 2005-08-02 at 20:36 +0100, Hathaikan Chootrakool wrote: