Displaying 1 result from an estimated 1 matches for "sacarelcoeficienteamano".
2012 Mar 31
2
lm no calcula un coeficiente
...rities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.283e+06 2.276e+04 -56.359 < 2e-16 ***
## x 9.696e-04 1.720e-05 56.359 < 2e-16 ***
## grupo2 8.940e-02 2.339e-02 3.823 0.000316 ***
## x:grupo2 NA NA NA NA
sacarelcoeficienteamano <- function(dat) {
fits <- lapply(split(dat,dat$grupo),lm,formula=y~x)
sums <- lapply(fits,summary)
coefs <- lapply(sums,coef)
db <- coefs[[2]]["x","Estimate"]-coefs[[1]]["x","Estimate"]
sd <- sqrt(sum(sapply(coefs,function(x)...