Displaying 1 result from an estimated 1 matches for "computebetas".
2012 Mar 21
0
How to create a function for a self created class.
...-------------------------------------------------------------------------------------------------------------------------
setClass("simpleOLS", representation(dataset="matrix", beta="matrix",
x="matrix", y="matrix", var="character"))
computeBetas = function(dataset,str) class('simpleOLS')
setMethod("computeBetas","simpleOLS",betas)
betas = function(dataset, str)
{
x<- cbind(int=1,dataset[-which(colnames(dataset) %in% str)])
y<- dataset[,length(dataset)]
names(x)<- NULL
names(y)<- NU...