search for: fittedmodel

Displaying 8 results from an estimated 8 matches for "fittedmodel".

1997 Oct 28
1
R-beta: Assigning column names in a data frame
...pping in R because the QR decomposition of the model matrix is stored with the fitted model. So far, so good. Then I got fancy and returned the result as a data frame. "bsCoefSample" <- ## Construct a bootstrap sample of coefficients from a ## fitted regression model function(fittedModel, Nsampl) { value <- as.data.frame(t(coef(fittedModel) + qr.coef(fittedModel$qr, matrix(sample(resid(fittedModel), length(resid(fittedModel)) * Nsampl, repl = T), ncol = Nsampl)))) names(value) <- names(coef(fittedModel)) value } Later I thought I c...
1997 Oct 17
1
R-beta: more model.matrix
...w them reasonably effective ways of doing the resampling. The following is a function I wrote to create bootstrap samples of coefficients from a fitted linear regression model. bsCoefSample <- ## Construct a bootstrap sample of coefficients from a ## fitted regression model function(fittedModel, Nsampl, ...) { coef(fittedModel) + qr.coef(qr(model.matrix(fittedModel)), matrix(sample(resid(fittedModel), length(resid(fittedModel)) * Nsampl, repl = T), ncol = Nsampl)) } It works ok with S-PLUS but the R version of model.matrix encounters difficulties. R&g...
2010 Jul 04
1
lm( y ~ A/x ) ... how do I extract the coefficients by factor?
...el I'm using which is: r[i+1] = a + b * r[i] + c * v[i] + e the model I'm using wants to create a new dataseries based on the coefficient in each month. I'm doing a simple linear regression on DataSet, and > DataSet$ByMonth <- format(DataSet$d, "%Y-%m"); > fittedmodel <- lm(r1 ~ ByMonth[2:n-1] / (r + v), x[2:n-1,1:10] ) I've think I've done it, and I think I've got the results: > summary(fittedmodel$coefficients) Min. 1st Qu. Median Mean 3rd Qu. Max. -2.896e-01 -6.624e-04 -4.051e-11 4.720e-02 2.748e-03 1.086e+0...
2011 Apr 12
0
cross-validation complex model AUC Nagelkerke R squared code
...an AUC value (for example with the pROC package) following the script: BaseRate <- table(Data$Y[[1]])/sum(table(Data$Y)) L(0)=Likelihood(Null-Model)= (BaseRate*log(BaseRate)+(1-BaseRate)*log(1-BaseRate))*sum(table(Data$Y)) LIKM <- predict(fit.glm, type="response") L(M)=Likelihood(FittedModell)=sum(Data$Y*log(LIKM)+(1-Data$Y)*log(1-LIKM)) R2 = 1-(L(0)/L(M))^2/n R2_max=1-(L(0))^2/n R2_Nagelkerke=R2/R2max library(pROC) AUC <- auc(Data$Y,LIKM) I checked this kind of caculation of R2_Nagelkerke and AUC-Value with the built-in calculation in package "Design" and got consiste...
2005 Dec 22
3
Windows crash in confint() with nls fit (PR#8428)
...ons on most of my machines and don't have a test version handy. On XP, I get an error-report-do-you-want- to-send-this-to-Microsoft dialog box. On 2000 I get a "Rgui has generated errors ..." dialog box. I can get this far: debug: profiledModel <- .Call("nls_iter", fittedModel, ctrl, trace, PACKAGE = "stats") Browse[1]> where where 1: prof$getProfile() where 2: profile.nls(object, which = parm, alphamax = (1 - level)/4) where 3: profile(object, which = parm, alphamax = (1 - level)/4) where 4: confint.nls(n1) where 5: confint(n1) I'm not set up t...
2005 Apr 25
2
residuals in lmer
Does anyone know how to extract residuals in lmer? Here's the error I get: > crop.lme=lmer(response~variety*irrigation*pesticide+(1|rep)+(1|rep: pesticide)+(1|rep:pesticide:irrigation), crop.data) > qqnorm(crop.lme) Error in qqnorm.default(crop.lme) : y is empty or has only NAs > resid(crop.lme) NULL Thanks! --Jake
2016 Apr 15
0
Decision Tree and Random Forrest
...the following untested code. newdata <- expand.grid( Humidity = levels(Humidity), #(High, Medium,Low) Pending_Chores = levels(Pending_Chores), #(Taxes, None, Laundry, Car Maintenance) Wind = levels(Wind)) # (High,Low) newdata$ProbabilityOfPlayingGolf <- predict(fittedModel, newdata=newdata) Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Apr 15, 2016 at 3:09 PM, Michael Artz <michaeleartz at gmail.com> wrote: > I need the output to have groups and the probability any given record in > that group then has of being in the response class. Just like...
2016 Apr 15
1
Decision Tree and Random Forrest
I need the output to have groups and the probability any given record in that group then has of being in the response class. Just like my email in the beginning i need the output that looks like if A and if B and if C then %77 it will be D. The examples you provided are just simply not similar. They are different and would take interpretation to get what i need. On Apr 14, 2016 1:26 AM,