Re: [R] Function input for regression analysis

2011-10-31 Thread Bert Gunter
I should have said: See also ?model.matrix -- Bert On Mon, Oct 31, 2011 at 9:00 AM, flokke wrote: > I know the lm() function, but I'd like to make my 'own' regression analysis > by using matrix algebra. > Thats why I wrote the function, > but I dont know what values to pick to make it suitable

Re: [R] Function input for regression analysis

2011-10-31 Thread Bert Gunter
Well, this just shows how much you don't understand. There is A LOT under the hood here, extending back to work in the 70's (Wilkinson and Rogers (1973) "Symbolic description of factorial models for analysis of variance" ) and probably before. See also McCullagh and Nelder's "Generalized Linear Mo

Re: [R] Function input for regression analysis

2011-10-31 Thread flokke
I know the lm() function, but I'd like to make my 'own' regression analysis by using matrix algebra. Thats why I wrote the function, but I dont know what values to pick to make it suitable for every dataset. If I pick a statistical model like lm(y~x) as input, the function would not know what o

Re: [R] Function input for regression analysis

2011-10-31 Thread R. Michael Weylandt
Have you seen the lm() function? I think it does what you are talking about, but the vagueries of your statement make it hard for me to give a concrete answer. It does worry me to think of you having one function to do all your regressions analysis ever for any problem whatsoever Michael On M

[R] Function input for regression analysis

2011-10-31 Thread flokke
Dear all, I have a small question. I would like to write a function for a regression analysis that an be applied to every dataset. Now my problem is that I do not know what I have to implement then as input for the function mytest <- function (x,y) { beta <- sol