Skip to content

regession code

2 messages · IZHAK shabsogh, Rui Barradas

#
Hello,

You are trying to get the coefficients of the function, nt of that 
function's result. Also, your function returns nothing. Try instead


fn <- function(x,y){
	lreg <- lm(y ~ x)
	lreg
}

fit <- fn(x,y)
b <- coef(fit)
b

Hope this helps,

Rui Barradas

Em 05-11-2013 10:56, IZHAK shabsogh escreveu: