[R] Help with a Loop

2007-12-03 Thread stathelp
I am having trouble getting a loop to work for the following problem. Any help would be much appreciated. Thanks. I need to find the slope and intercept from the linear regression of Drug Level on Day by Participant. There are a total of 37 Participants. I need to store the Participant, Label, Sl

[R] finding roots (Max Like Est)

2007-11-30 Thread stathelp
I have this maximum liklihood estimate problem i need to find the roots of the following: [sum (from i=1 to n) ] ((2(x[i]-parameter)/(1+(x[i]-parameter)^2))=0 given to me is the x vector which has length 100 how would I find the roots using R? I have 2 thoughts.. 1 is using a grid search