search for: mcreg

Displaying 5 results from an estimated 5 matches for "mcreg".

Did you mean: creg
2009 Dec 03
0
Problem with predict() and factors
...ing)") #Ok our ranges are comfirmed we'll get a better graph later # This Heavy Voodoo™ allows us to have a dynamic number of #dummy variables we can add\remove from the spreadsheet forecastDistance <- 52 #Grab Existing Regressors (clipping out the data) cReg <- sh2[1:modLength,-1] mcReg <- sh2[1:modMax,-1] #transform the on\offs into proper factors for(i in names(cReg)) cReg[[i]] <- factor(cReg[[i]]) for(i in names(mcReg)) mcReg[[i]] <- factor(mcReg[[i]]) #Grab X Future Regressors equal to the forecastDistance (gotta double check if I need a +1 on the start point) fReg &l...
2009 Jul 15
2
Spaces in a name
I am reading regressors from an excel file (I have no control over the file) and some of the element names have spaces: i.e. "Small Bank Aquired" but I have found that lm(SourceData ~ . - "Small Bank Aquired", mcReg) doesn't work (mcReg = modelCurrentRegressors) As they are toggles I have ran them through factor() to be treated propertly as 0 or 1 but due to the fact I am grabbing automagically the first 2/3rds of the data some of the regressors are either all 0s or all 1s accordingly so I need to take th...
2009 Jul 15
2
storing lm() results and other objects in a list
to clean up some code I would like to make a list of arbitrary length to store?various objects for use in a loop sample code: ############ BEGIN SAMPLE ############## # You can see the need for a loop already linearModel1=lm(modelSource ~ .,mcReg) linearModel2=step(linearModel1) linearModel3=lm(modelSource ~ .-1,mcReg) linearModel4=step(linearModel3) #custom linearModel5=lm(modelSource ~ . -ACF-MonthlyST1-MonthlyST2-MonthlyBLA,mcReg) LinearModel1.res <- residuals(linearModel1) LinearModel2.res <- residuals(linearModel2) LinearModel3....
2012 Jan 03
1
returning information from functions via attributes rather than return list
...ork to write the new information as object attributes, and it seems to work. There is a generic function "meanCenter" and a method "meanCenter.default". At the end of meanCenter.default, here's my use (or abuse) of attributes. res <- eval(mc) class(res) <- c("mcreg", class(model)) attr(res, "centeredVars") <- nc attr(res, "centerCall") <- match.call() res I wrote print and summary methods, but other methods that work for lm objects like plot will also work for these new ones. meanCenter <- function(model, centerOnl...
2009 Jul 21
2
Odd coefficent behavior
...TBUILD + UNITDB + ITBUILD + ITDB + UATBUILD + UATDB + HOGANCODE + RCF + ReleaseST1 + ReleaseST2 + ReleaseBLA + Small.Bank.Acquisitions + HLY.NewYear + HLY.MLK + HLY.PRES + HLY.MEMORIAL + HLY.J4 + HLY.LABOR + HLY.COLUMBUS + HLY.VETS + HLY.THANKS + HLY.XMAS + HLY.ELECT + HLY.PATRIOT + EOM, data = mcReg) Coefficients: (Intercept) UNITBUILD1 UNITDB1 405.8326 -8.5675 13.5029 ITBUILD1 ITDB1 UATBUILD1 33.0950 -6.1938...