search for: lmfirst

Displaying 1 result from an estimated 1 matches for "lmfirst".

Did you mean: mfirst
2007 Dec 02
3
Help with a Loop
...1.55323 216 0 3 9 1.24088 65 0 4 8 2.49412 69 0 4 5 1.79840 This is my thought process of what the loop needs to do but I cant get the correct loop. X1=Day[Participant=="1"] Y1=DrugLevel[Participant=="1"] Coeffs=function(X1,Y1) { lmfirst=lm(Y1~X1) lmfirst$coefficients } Coeffs(X1,Y1) # output slope and intercept here # do same for the next participant X2=Day[Participant=="2"] Y2=DrugLevel[Participant=="2"] Coeffs=function(X2,Y2) { lmfirst=lm(Y2~X2) lmfirst$coefficients } Coeffs(X2,Y2) # output slope and in...