similar to: Using all variables in a linear model

Displaying 20 results from an estimated 20000 matches similar to: "Using all variables in a linear model"

2011 Jan 28
6
User error in calling predict/model.frame
I want to predict values from an existing lm (linear model, e.g. lm.obj) result in R using a new set of predictor variables (e.g. newdata). However, it seems that because my linear models was made by calling scale() on the target predictor that predict exits with an error, "Error in scale(xxA, center = 9.7846094491829, scale = 0.959413568556403) : object 'xxA' not found". By
2012 Aug 01
1
rpart package: why does predict.rpart require values for "unused" predictors?
After fitting and pruning an rpart model, it is often the case that one or more of the original predictors is not used by any of the splits of the final tree. It seems logical, therefore, that values for these "unused" predictors would not be needed for prediction. But when predict() is called on such models, all predictors seem to be required. Why is that, and can it be easily
2005 Mar 22
3
mixtures as outcome variables
Dear R-users, I have an outcome variable and I'm unsure about how to treat it. Any advice? I have spending data for each county in the state of California (N=58). Each county has been allocated money to spend on any one of the following four categories: A, B, C, and D. Each county may spend the money in any way they see fit. This also means that the county need not spend all the money that
2010 Oct 27
2
coxph linear.predictors
I would like to be able to construct hazard rates (or unconditional death prob) for many subjects from a given survfit. This will involve adjusting the ( n.event/n.risk) with (coxph object )$linear.predictors I must be having another silly day as I cannot reproduce the linear predictor: fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian) fit$linear.predictors[1] [1] 2.612756
2005 Mar 21
1
rpart memory problem
Hi everyone, I have a problem using rpart (R 2.0.1 under Unix) Indeed, I have a large matrix (9271x7), my response variable is numeric and all my predictor variables are categorical (from 3 to 8 levels). Here is an example : > mydata[1:5,] distance group3 group4 group5 group6 group7 group8 pos_1 0.141836040224967 a c e a g g pos_501
2003 Apr 07
2
log-linear
hello I have spatial data which contain number of landslide presence cells with respect to landslide predictors and number of landslide absence cells with respect to same predictors. predictors are essentially categorical data. I tried logistic regression. But because of providing interaction capability of predictors, I want to use log-linear method. I hesitate the way I should use
2004 Jun 11
1
Error when I try to build / plot a tree using rpart()
Hi, I am using the rpart package to build a classification tree. I did manage to build a tree with data on a previous project. However, when attampting to build a tree on a project I am working on, I seem to be getting the error shown below: > nhg3.rp <- rpart(profitresp ~., nhg3, method="class") > plot(nhg3.rp, branch=0.4, uniform=T); text(nhg3.rp, digits=3) Error in
2006 Jan 29
2
SoS! How to predict new values using linear regression models?
Hi all, After trial and error by myself for a few hours, I decide to ask for your help. I have a training set which is a matrix of size 200 x 2, where the two columns denote each independent variable. I have 200 observations. ----------------- ss=data.frame(trainingSet); result=lm(trainingClass~ss$X1+ss$X2); ----------------- where trainingClass denotes the true classes of the training data.
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. All three
2010 Mar 28
6
Coding of categorical variables for logistic regression?
Hello, I am trying to do a logistic regression and have one predictor variable (x) that is ratio and two predictor variables (y and z) that are categorical. These have three levels each which I have called "High", "Medium" and "Low". My question: do I need to use a numerical coding scheme for the categorical variables as required by some statistical software
2009 Mar 31
2
[LLVMdev] Static Profiling - GSoC 2009
Hello all, I would like to participate in this year's Google Summer of Code and I am sending you a short description of my proposal. I have written the formal proposal already and if someone is interested I can send him the pdf. One of the open projects in the LLVM list is to enhance LLVM with static profiling capabilities. LLVM already provides a unified structure for writing pro
2007 Jan 22
2
Combination of variables
Hi, List , i have 6 predictor variables and i want to make possible combinations of these 6 predictors ,all the data is in matrix form , if i am having 6 predictors than possible combination of sets are 64 2 power 6, or 63 ,whatever it may be i want to store the result in another variable to each combination and that i want to put in some model , i want to put every combination in some model
2010 Dec 03
2
difference between linear model & scatterplot matrix
Dear R-users, I'm studing a DB, structured like this (just a little part of my dataset): _____________________________________________________________________________________________________________ Site Latitude Longitude Year Tot-Prod Total_Density dmp Dendoudi-1 15.441964 -13.540179 2005 3271.16 1007 16993.25 Dendoudi-2 15.397321 -13.611607
2024 Apr 15
2
Synthetic Control Method
Good Morning I want to perform a synthetic control method with R. For this purpose, I created the following code: # Re-load packages library(Synth) library(readxl) # Pfadeinstellung Excel-Blatt excel_file_path <- ("C:\\Users\\xxxxx\\Desktop\\DATA_INVESTMENTVOLUMEN_FOR_R_WITHOUT_NA.xlsx") # Load the Excel file INVESTMENTVOLUME <- read_excel(excel_file_path) #
2004 Oct 29
3
missing values in logistic regression
Dear R help list, I am trying to do a logistic regression where I have a categorical response variable Y and two numerical predictors X1 and X2. There are quite a lot of missing values for predictor X2. eg., Y X1 X2 red 0.6 0.2 * red 0.5 0.2 * red 0.5 NA red 0.5 NA green 0.2 0.1 * green 0.1 NA green 0.1 NA green 0.05 0.05 * I am wondering can I combine X1 and
2002 May 22
4
fitting non linear data
Hye every one, My question will certainly seem stupid as I am quite a beginner in R. I would like to trace a curve which fits these two vectors: x<-c( 2,3,4,5,6,7,8,10 ) y<-c( 20, 12, 8, 6, 5, 4.5, 4, 3.8) It seems to follow a non linear model. Could anyone help me because I could'nt find the answer I am looking for in the FAQs. In advance thank you for your time. G. Lefebvre
2009 Aug 03
1
min frequencies of categorical predictor variables in GLM
Hi, Suppose a binomial GLM with both continuous as well as categorical predictors (sometimes referred to as GLM-ANCOVA, if I remember correctly). For the categorical predictors = indicator variables, is then there a suggested minimum frequency of each level ? Would such a rule/ recommendation be dependent on the y-side too ? Example: N is quite large, a bit > 100. Observed however are
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
2011 May 16
1
Linear Discriminant Analysis error: "Variables appear constant"
Hi R experts, I'm attempting to run Linear Discriminant Analysis using the lda function in the MASS package. I've got around 50 predictor variables and one response variable. My response variable has 5 numeric categories that represent different clusters of fish abundance data (clusters were developed using Bray-Curtis and NMDS), and my predictor variables are environmental variables that
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, the plot should have 4 lines (mean