seedols | R Documentation |
Returns ordinary least squares estimates. And, the function results in subclass "seedols". For this function to work, either X or Y has to be one-dimensional. It is not necessary that X and Y should be predictors and response, respectively. Regardless of the position in the arguments, the one-dimensional and multi-dimensional variables become response and predictors, respectively.
seedols(X, Y)
X |
numeric vector or matrix, a first set of variables |
Y |
numeric vector or matrix, a second set of variables |
coef |
the estimated coefficients for each iterative projection upto u |
X |
X, the first set |
Y |
Y, the second set |
######## data(cookie) ######## data(cookie) myseq<-seq(141,651,by=2) X<-as.matrix(cookie[-c(23,61),myseq]) Y<-as.matrix(cookie[-c(23,61),701:704]) ols1 <- seedols(X[,1:4],Y[,1]) ols2 <- seedols(Y[,1],X[,1:4]) ## ols1 and ols2 are the same results.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.