search for: predictor2

Displaying 9 results from an estimated 9 matches for "predictor2".

Did you mean: predictor
2013 Jul 20
2
Different x-axis scales using c() in latticeExtra
...he 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), panel = function(x, y, ...) { panel.xyplot(x, y, type = c("p&qu...
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 predictor2 predictor3 measurement1 measurement2 1 1 a a...
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 criterion, independent of the ot...
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 not all fitt...
2005 Mar 10
2
Logistic regression goodness of fit tests
...at 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 match. Then my...
2010 Oct 20
1
problem with predict(mboost,...)
...o 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 -------------------...
2007 Apr 18
0
Specifying ANCOVA models in R
...ificant 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(Model)), bu...
2009 Dec 14
0
GBM package: Extract coefficients
...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 at least po...
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) x1.filter <-...