Displaying 20 results from an estimated 2069 matches for "predictor".
2010 Apr 09
0
step function
Hello I am using the step function in order to do backward selection for a
linear model of 52 variables with the following commands:
object<-lm(vars[,1] ~ (vars[,2:(ncol(predictors)+1)]-1))
BackS<-step(object,direction="backward")
but it isn't dropping any if the variables in the model, but there are lots
of not significant variables as you can see here
> object<-lm(vars[,1] ~ (vars[,2:(ncol(predictors)+1)]-1))
> summary(object)
Call:
lm(formula =...
2011 Jul 29
4
finding a faster way to run lm on rows of predictor matrix
Hi, everyone.
I need to run lm with the same response vector but with varying predictor vectors. (i.e. 1 response vector on each individual 6,000 predictor vectors)
After looking through the R archive, I found roughly 3 methods that has been suggested.
Unfortunately, I need to run this task multiple times(~ 5,000 times) and would like to find a faster way than the existing methods.
Al...
2024 Apr 15
2
Synthetic Control Method
...UME <- read_excel(excel_file_path)
# Anzeigen des gesamten Dataframes
print(INVESTMENTVOLUME)
# Make sure BFS is numeric right before dataprep
INVESTMENTVOLUME$BFS <- as.numeric(INVESTMENTVOLUME$BFS)
# running dataprep
dataprep_out <- dataprep(
foo = INVESTMENTVOLUME,
predictors = c("Predictor 1", " Predictor 2", " Predictor 3" Predictor 4",
" Predictor 5", " Predictor 6"),
special.predictors = list(list("Special Predictor 1", seq(1, 12, by =
1))),
dependent = "INVESTMENTVOLUME_12_MONTH_AVERAGE&qu...
2004 Sep 22
5
Issue with predict() for glm models
[This email is either empty or too large to be displayed at this time]
2008 Nov 11
1
simulate data with binary outcome and correlated predictors
Hi,
I would like to simulate data with a binary outcome and a set of predictors that are correlated. I want to be able to fix the number of event (Y=1) vs. non-event (Y=0). Thus, I fix this and then simulate the predictors. I have 2 questions:
1. When the predictors are continuous, I can use mvrnorm(). However, if I have continuous, ordinal and binary predictors, I'm not...
2012 May 26
1
Plotting interactions from lme with ggplot
I'm fitting a lme growth curve model with two predictors and their
interaction as predictors. The multilevel model is nested so that level 1 is
time within the individual, and level 2 is the individual. I would like to
plot the mean group-level trajectories at plus and minus 1 SD from the mean
of the main effects composing the interaction term. Thus,...
2009 Apr 20
1
Random Forests: Predictor importance for Regression Trees
Hello!
I think I am relatively clear on how predictor importance (the first
one) is calculated by Random Forests for a Classification tree:
Importance of predictor P1 when the response variable is categorical:
1. For out-of-bag (oob) cases, randomly permute their values on
predictor P1 and then put them down the tree
2. For a given tree, subtract th...
2017 Jun 29
3
Help : glm p-values for a factor predictor
Hello,
i am a newby on R and i am trying to make a backward selection on a
binomial-logit glm on a large dataset (69000 lines for 145 predictors).
After 3 days working, the stepAIC function did not terminate. I do not
know if that is normal but i would like to try computing a "homemade"
backward with a repeated glm ; at each step, the predictor with the max
pvalue would be excluded until reaching a set of 20 predictors for...
2010 Mar 09
2
looping through predictors
Dear R-ers,
I have a data frame data with predictors x1 through x5 and the
response variable y.
I am running a simple regression:
reg<-lm(y~x1, data=data)
I would like to loop through all predictors. Something like:
predictors<-c("x1","x2",... "x10)
for(i in predictors){
reg<-lm(y~i)
etc.
}
But it's not wo...
2009 Nov 02
2
convert list to numeric
...unning into problems. I
have imported the data set into "task" (data frame). The data frame is made
of factors with variable names in the first row. I am running a loop to set
a variable equal to a column in the data frame. Here is an example of my
problem:
for (i in 1:dim(task)[2]){
predictor.loop <- c(task[i])
predictor.loop.mc <- predictor.loop - mean(predictor.loop, na.rm=T)
}
I get the following error:
Error in predictor.loop - mean(predictor.loop, na.rm = T) :
non-numeric argument to binary operator
In addition: Warning message:
In mean.default(predictor.loop, na.rm = T)...
2019 Aug 30
3
inconsistent handling of factor, character, and logical predictors in lm()
Dear R-devel list members,
I've discovered an inconsistency in how lm() and similar functions handle logical predictors as opposed to factor or character predictors. An "lm" object for a model that includes factor or character predictors includes the levels of a factor or unique values of a character predictor in the $xlevels component of the object, but not the FALSE/TRUE values for a logical predictor e...
2010 Aug 07
3
plot the dependent variable against one of the predictors with other predictors as constant
Hi, folks,
Happy work in weekends >_<
My question is how to plot the dependent variable against one of the
predictors with other predictors as constant. Not for the original data, but
after prediction. It means y is the predicted value of the dependent
variables. The constane value of the other predictors may be the average or
some fixed value.
#######
y=1:10
x=10:1
z=2:11
lin_model=lm(z~x+y)
x_new=11:2
#######...
2017 Jun 29
0
Help : glm p-values for a factor predictor
...s for each level" is wrong: look
at the anova() function.
Bob
On 29 June 2017 at 11:13, Beno?t PELE <benoit.pele at acoss.fr> wrote:
> Hello,
>
> i am a newby on R and i am trying to make a backward selection on a
> binomial-logit glm on a large dataset (69000 lines for 145 predictors).
>
> After 3 days working, the stepAIC function did not terminate. I do not
> know if that is normal but i would like to try computing a "homemade"
> backward with a repeated glm ; at each step, the predictor with the max
> pvalue would be excluded until reaching a set of...
2010 May 05
2
Visualizing binary response data?
Hi All,
I'm dealing with binary response data for the first time, and I'm confused
about what kind of graphics I could explore in order to pick relevant
predictors and their relation with response variable.
I have 8-10 continuous predictors and 4-5 categorical predictors. Can anyone
suggest what kind of graphics I can explore to see how predictors behave
w.r.t. response variable...
Any help would be greatly appreciated, thanks,
Kim
[[alternative HTML ver...
2019 Aug 31
2
inconsistent handling of factor, character, and logical predictors in lm()
Dear Abby,
> On Aug 30, 2019, at 8:20 PM, Abby Spurdle <spurdle.a at gmail.com> wrote:
>
>> I think that it would be better to handle factors, character predictors, and logical predictors consistently.
>
> "logical predictors" can be regarded as categorical or continuous (i.e. 0 or 1).
> And the model matrix should be the same, either way.
I think that you're mistaking a coincidence for a principle. The coincidence is that FALSE/TRUE...
2010 May 14
4
Categorical Predictors for SVM (e1071)
Dear all,
I have a question about using categorical predictors for SVM, using "svm"
from library(e1071). If I have multiple categorical predictors, should they
just be included as factors? Take a simple artificial data example:
x1<-rnorm(500)
x2<-rnorm(500)
#Categorical Predictor 1, with 5 levels
x3<-as.factor(rep(c(1,2,3,4,5),c(50,150,13...
2009 Sep 04
3
Using anova(f1, f2) to compare lmer models yields seemingly erroneous Chisq = 0, p = 1
...ng
lmer() to model my data, and using anova() to compare the fit of various
models. When I run two models, the output of each model is generated
correctly as far as I can tell (e.g. summary(f1) and summary(f2) for the
multilevel model output look perfectly reasonable), and in this case (see
below) predictor.1 explains vastly more variance in outcome than predictor.2
(R2 = 15% vs. 5% in OLS regression, with very large N). What I am utterly
puzzled by is that when I run an anova comparing the two multilevel model
fits, the Chisq comes back as 0, with p = 1. I am pretty sure that fit #1
(f1) is a much...
2012 Jun 06
0
randomForest Species Distribution Modelling
Hi,
I appologise if this is a rudimentary question and long winded but I just
wanted to let ye know where I'm comming from. I'm new to R and I'm trying to
use the 'randomForest' package to classify and predict. The Error message
that is troubling me is:
> pr<-predict(predictors,rf1, ext=ext)
Error in x[...] <- m : NAs are not allowed in subscripted assignments
In addition: Warning message:
'newdata' had 153595 rows but variable(s) found have 109 rows
My steps are outlinded below which hopefully will give you insight into
where I'm going horribly wrong....
2011 Mar 07
2
use "caret" to rank predictors by random forest model
Hi,
I'm using package "caret" to rank predictors using random forest model and draw predictors importance plot. I used below commands:
rf.fit<-randomForest(x,y,ntree=500,importance=TRUE)
## "x" is matrix whose columns are predictors, "y" is a binary resonse vector
## Then I got the ranked predictors by ranking "rf1$...
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)...