search for: regmatrix

Displaying 1 result from an estimated 1 matches for "regmatrix".

Did you mean: dgematrix
2008 Apr 29
2
Running regression (lm, lrm) 100+ times and saving the results as matrix
...e to run regression separately for each month (or year). The below shows how I ran the regression for each month, but I need to know how I would combine the regression results together into a matrix possibly. Thank you! Mike ------------------------------- m = max(data$TIME) # define regmatrix for(i in 1:m){ g=runreg(data, i) # attach g to regmatrix } runreg = function(data, index){ datainterim = subset(data, TIME==index) g = lrm(X ~ A + B, datainterim) return(g) } [[alternative HTML version deleted]]