search for: bcoef

Displaying 4 results from an estimated 4 matches for "bcoef".

Did you mean: coef
2007 Oct 03
2
Shading area under density curves
...ng regions under curves to display 95% confidence intervals. I generated bootstrap results for the slope and intercept of a simple linear regression model using the following code (borrowed from JJ Faraway 2005): > attach(allposs.nine.d) > x<-model.matrix(~log(d.dist,10))[,-1] > bcoef<-matrix(0,1000,2) > for(i in 1:1000){ + newy<-predict(all.d.nine.lm)+residuals(all.d.nine.lm)[sample(1002,rep=TRUE)] + brg<-lm(newy~x) + bcoef[i,]<-brg$coef + } Where "allposs.nine.d" is a data file composed of two columns: (1) geographical distances between sample point...
2012 Mar 18
1
Help with dlply, loop and column names
...loop I'm coming into trouble and I'm at the moment really confused how to solve this problem: I have the following function: elecregtipos <- function(y){ z<-dlply(asturias.gen2011, .(tipo), function(x) lm(x[,y]~x$edad.media)) # rsq<-function(x) summary(x)$r.squared # bcoefs<-ldply(z, function(x) c(coef(x), rsquare=rsq(x))) # return (bcoefs) return(z) } And I try to call it with: for (y in c("upyd", "psoe", "pp", "fac", "iu")) { eval(parse(text=paste(y,'.lm.tipos', '<- elecregtipos(',...
2007 Jun 20
2
Extracting t-tests on coefficients in lm
I am writing a resampling program for multiple regression using lm(). I resample the data 10,000 times, each time extracting the regression coefficients. At present I extract the individual regression coefficients using brg = lm(Newdv~Teach + Exam + Knowledge + Grade + Enroll) bcoef[i,] = brg$coef This works fine. But now I want to extract the t tests on these coefficients. I cannot find how these coefficients are stored, if at all. When I try attributes(brg) I do not find the t values as the attributes of the object. Typing summary(brg) will PRINT the coefficients, th...
2012 Nov 21
0
Question about VAR (Vector Autoregression) in differences.
...Rpath<-function(object, n.ahead, mult = 1) { K <- object$K p <- object$p obs <- object$obs type <- object$type data.all <- object$datamat ynames <- colnames(object$y) n.ahead <- as.integer(n.ahead) Z <- object$datamat[, -c(1:K)] B <- Bcoef(object) if (type == "const") { Zdet <- matrix(rep(1, n.ahead), nrow = n.ahead, ncol = 1) colnames(Zdet) <- "const" } else if (type == "trend") { trdstart <- nrow(Z) + 1 + p Zdet <- matrix(seq(trdstart, length = n....