search for: predictor1

Displaying 12 results from an estimated 12 matches for "predictor1".

Did you mean: predictor
2009 Dec 10
2
different randomForest performance for same data
...g the levels of the training dataset on the testdataset. I only assign the levels and do not change the dataset itself however the models perform different. Why??? Here is my code: > library(randomForest) > load("datasets.RData") # import traindat and testdat > nlevels(traindat$predictor1) [1] 20 > nlevels(testdat$predictor1) [1] 19 > nrow(traindat) [1] 9838 > nrow(testdat) [1] 3841 > set.seed(10) > rf_orig <- randomForest(x=traindat[,-1], y=traindat[,1], xtest=testdat[,-1], ytest=testdat[,1],ntree=100) > data.frame(rf_orig$test$err.rate)[100,1] # Error on...
2013 Jul 20
2
Different x-axis scales using c() in latticeExtra
...p the tick labels. However, when I try all of these, the x-axis scale of the first panel is used for all three. How do I keep different scales for the different panels? Here is an example: library(lattice) library(latticeExtra) response <- c(76, 14, 15, 44, 26, 19, 74, 123, 49, 8, 56, 17, 18) predictor1 <- c(107, 7, 25, 501, 64, 88, 344, 367, 379, 10, 66, 31, 32) predictor2 <- c(10, 9, 8, 10, 29, 27, 55, 48, 2, 6, 14, 10, 5) predictor3 <- c(67, 22, 66, 41, 72, 64, 69, 63, 64, 70, 60, 75, 78) pred1_plot <- xyplot(response ~ predictor1, scales = list(log = TRUE, equispaced.log = FALSE),...
2010 Oct 20
1
problem with predict(mboost,...)
...predicted values to the value range from 3 to 8 I limit the feature space of the prediction data on the minima and maxima of the training data for every predictor variable before applying the model on the new data. As baselearner in mboost I use splines ("bbs"): mod <- mboost(MF ~ bbs(predictor1) + bbs(predictor2) + bbs(...), data = train) I wonder why there are negative values when applying the model on new data, because both, training and prediction data have the same value ranges in the predictor variables. Did somebody get the same warning message? Can someone help me please? TIM -...
2009 Jul 15
0
strategy to iterate over repeated measures/longitudinal data
Hi Group, Create some example data. set.seed(1) wide_data <- data.frame( id=c(1:10), predictor1 = sample(c("a","b"),10,replace=TRUE), predictor2 = sample(c("a","b"),10,replace=TRUE), predictor3 = sample(c("a","b"),10,replace=TRUE), measurement1=rnorm(10), measurement2=rnorm(10)) head(wide_data) id predictor1 predic...
2009 Dec 14
0
GBM package: Extract coefficients
...to be able to extract the coefficients produced for storage in a database. I am already using R to automatically generate formulas that I can export to a database and store. For example, I have been using Dr. Harrell's lrm package to perform logistic regression, e.g.: output <- lrm(outcome~predictor1+predictor2,data=dataset) cat(output$coefficients) This allows me to take input (predictor1) from a user, multiply it by the correctly transformed $coefficient, and to produce a success probability without having to run R again. Is it possible to do this with gbm? If not in general, is it perhaps...
2010 May 10
0
Plotting residuals from a sem object
R experts - I'm using John Fox's sem package to analyze a simple path model (two correlated predictor variables directly influencing a single criterion variable): Predictor1 -> Criterion Predictor2 -> Criterion Predictor1 <-> Predictor2 I'm giving a presentation on this material next week, and I'd like to use component-residual plots (i.e., partial residual plots) to help the audience visualize the effect of one the predictor variables on the crite...
2017 Aug 15
1
ANOVA test to decide whether to use multiple linear regression or linear mixed effects model
R-help: I am trying to decide between using a multiple linear regression or a linear mixed effects model for my data: model1 <- lm (responsevariable ~ predictor1 + predictor2 + predictor3 + predictor4, data= data) model2 <- lme (responsevariable ~ predictor1 + predictor2 + predictor3 + predictor4, random = ~1 | site, data= data) anova (model1, model2) but I keep getting the following error code: Error in anova.lmlist (object, ...): models were...
2009 Dec 16
2
rcart - classification and regression trees (CART)
Hi, I am trying to use CART to find an ideal cut-off value for a simple diagnostic test (ie when the test score is above x, diagnose the condition). When I put in the model fit=rpart(outcome ~ predictor1(TB144), method="class", data=data8) sometimes it gives me a tree with multiple nodes for the same predictor (see below for example of tree with 1 or multiple nodes). Is there a way to tell it to make only 1 node? Or is it safe to assume that the cut-off value on the primary node is the...
2005 Mar 10
2
Logistic regression goodness of fit tests
...unsure of what suitable goodness-of-fit tests existed in R for logistic regression. After searching the R-help archive I found that using the Design models and resid, could be used to calculate this as follows: d <- datadist(mydataframe) options(datadist = 'd') fit <- lrm(response ~ predictor1 + predictor2..., data=mydataframe, x =T, y=T) resid(fit, 'gof'). I set up a script to first use glm to create models use stepAIC to determine the optimal model. I used this instead of fastbw because I found the AIC values to be completely different and the final models didn't always ma...
2007 Apr 18
0
Specifying ANCOVA models in R
...re are significant differences in their means between the clusters: That is I have one fixed effect with 2 levels, and a bunch of 7 continuous predictors. I believe the correct model specification is an ANCOVA design(?) I can fit this model in MINITAB using, say: glm response = cluster; covariate predictor1 predictor2 ... predictor7. In R, if I specify the model using cluster<-ordered(clusterlevels=c("Low","High")) Model<-lm(predictor~response1+response2+ ... response7+cluster) I can replicate the results from MINITAB, getting identical P and t values when I do summary(lm(...
2010 Jun 18
0
pcse package - is it OK to use it when my regression is weighted by each subgroup's mean
Hello! Just would like to make sure I am not doing something wrong. I am running an OLS regression. I have several subgroups in the data set (locations) - and in each location I have weekly data for 2 years - on my DV and on all predictors. Looks like this: location week DV Predictor1 Predictor 2 location1 week1 xxx xxxxxxx xxxxxxxxx location1 week2 xxx xxxxxxx xxxxxxxxx . . . location2 week1 xxx xxxxxxx xxxxxxxxx location2 week2 xxx xxxxxxx xxxxxxxxx My DV variable was mean-centered - for each location and I am using this mean-centered DV as the DV in...
2011 Nov 18
0
Kalman Filter with dlm
I have built a Kalman Filter model for flu forecasting as shown below. Y - Target Variable X1 - Predictor1 X2 - Predictor2 While forecasting into the future, I will NOT have data for all three variables. So, I am predicting X1 and X2 using two Kalman filters. The code is below x1.model <- dlmModSeas(52) + dlmModPoly(1, dV=5, dW=10) x2.model <- dlmModSeas(52) + dlmModPoly(1, dV=10, dW=10)...