similar to: lm with predictor matrix

Displaying 20 results from an estimated 900 matches similar to: "lm with predictor matrix"

2007 Jul 17
2
SLLOOOWWW function ...
Does anybody have any insight into how to make this faster? I suspect, that the rounding going on may be an issue, as is the stepping through data frame rows using integers ... If you have the patience to teach a noob, he will highly appreciate it ;0) Joh digit <- 4 for (minute in seq(from=25,to=lrange[2])){ # Extract all data associtaed with the current time (minute) frame <-
2005 Aug 12
1
as.formula and lme ( Fixed effects: Error in as.vector(x, "list") : cannot coerce to vector)
This is a continuing issue with the one on the list a long time ago (I couldn't find a solution to it from the web): -------------------------------------------------------------------------- > Using a formula converted with as.formula with lme leads > to an error message. Same works ok with lm, and with > lme and a fixed formula. > > # demonstrates problems with lme and
2001 Feb 23
1
as.formula and lme ( Fixed effects: Error in as.vector(x, "list") : cannot coerce to vector)
Using a formula converted with as.formula with lme leads to an error message. Same works ok with lm, and with lme and a fixed formula. # demonstrates problems with lme and as.formula demo<-data.frame(x=1:20,y=(1:20)+rnorm(20),subj=as.factor(rep(1:2,10))) demo.lm1<-lme(y~x,data=demo,random=~1|subj) print(summary(demo.lm1)) newframe<-data.frame(x=1:5,subj=rep(1,5))
2011 Sep 13
1
implicit data frame reference
If I create an aggregation like this: aggregate(lastYear[,8:10],list(Stadium=lastYear$STAD),mean) I'll get a new data frame, which I can order if I assign it like this: newFrame <- aggregate(lastYear[,8:10],list(Stadium=lastYear$STAD),mean) newFrame[order(newFrame$TEMP),] But.. if I just want to do this in one statement, what can I do? If this was perl, I'd be using something like
2011 Mar 19
1
strange PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL
Hi Dears, When I introduce an interaciton in a piecewise model I obtain some quite unusual results. If that would't take u such a problem I'd really appreciate an advise from you. I've reproduced an example below... Many thanks x<-rnorm(1000) y<-exp(-x)+rnorm(1000) plot(x,y) abline(v=-1,col=2,lty=2) mod<-lm(y~x+x*(x>-1)) summary(mod) yy<-predict(mod)
2005 Sep 08
1
Converting a matrix to a dataframe: how to prevent conversion to factor
Colleages I am running R 2.1.0 on a Mac (same problem occurs in Linux). In some situations, I have mixed text/numeric data that is stored as characters in a matrix. If I convert this matrix to a dataframe, the numeric data becomes factors, not what I intend. TEXT <- paste("Text", 1:4, sep="") NUMBERS <- 10 + 4:1 MATRIX <- cbind(TEXT,
2003 Nov 04
1
Binaries for ROracle and V 1.8. needed
Sorry for re-posting this message; the first one was lost in another thread. >Hi, > there is no Oracle Client on my machine (Redhat Linux 9.0/686i, > R1.8.0). I cannot thus compile the ROracle package. > I read the readme.client file and did: > I unziped the package ROracle and copied it into the R-library path. > I get: > >library(ROracle) > Error in
2004 Mar 26
4
multicolumn sort on dataframe?
I couldn't find any reference to this in the FAQ, but is it possible to sort a dataframe by multiple columns? I've created some code, similar to the following: nspr.code <- sp.results$sp.code[order( sp.results$sp.code )] nspr.tpa <- sp.results$tpa[order( sp.results$sp.code )] nspr.code <- as.character( levels( nspr.code ) )[nspr.code] nspr.tpa <- as.numeric( levels( nspr.tpa
2006 Sep 13
7
inserting columns in the middle of a dataframe
Dear R users: Is there a built-in and simple way to insert new columns after other columns in a dataframe? I.e. currently I have: V1 V2 V3 V4 [1,] [2,] Etc. But I want V1 V5 V2 V3 V4 [1,] [2,] Etc. Can this be done in one line? Jon Minton [[alternative HTML version deleted]]
2004 Mar 29
1
Right shift for normality
Hello, My data is discrete, taking values between around -5 and +5. I cannot give bounds for the values. So I consider it as numerical data and not categorical data. The histogram has a 'normal' shape, so I test for normality via a chisquare statistic (by calculating the expected values by hand). When I use the sample mean and variance, the normality hypothesis has to be rejected.
2011 Mar 18
1
PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL: THEY AIN'T LINEAR BETWEEN BREAK POINTS!!
I Dears, if that wouldn't take u too much effort I'd like to ask for a swift opinion: I have a alinear (mixed effect) model that I wish to run as a piecewise one. When I predict the values Iget quite some odds and disturbing results: The predicted stright line after the break point is not straight at all, instead behaves like if it was a hig order polynomial or something similar!!!! I
2007 Oct 08
2
as.ordered
Hello Members, I try to convert variables in a data.frame (bract.awn) in the class ordered. str(bract.awn) 'data.frame': 348 obs. of 2 variables: $ bracts.length.relative.to.flower...............Min: Factor w/ 4 levels "1","2","3","4": 2 3 3 3 3 2 1 4 3 2 ... $ bract.awn.relative.to.body.................Max : Factor w/ 4 levels
2010 Jun 18
5
extract date time from a text file
I a have a text file where every line is like that: "2007-12-03 13:50:17 Juan Perez" ("yy-mm-dd hh:mm:ss First Name Second Name") I would like to make a data frame with two column one for date and the other one for name. When I use read.delim it was transformed in a data frame with 4 colums. Bye, Sebasti?n.
2003 Aug 29
2
extract numerical variables from a data frame
Hi I try to create from a data frame a new one which contains only the numerical variables (or factorial ones). Is there any function which does this task directly ? Or, is there any function which return the mode of each columns of a data frame. ? Thanks a lot for any help you can offer me, Vincent Spiesser
2010 Nov 10
1
Inserting Missing Data
Greetings I'm attempting to insert missing data on the smallest size class of cave cricket instars into a data frame. The data involve censusing photoplots (plots) of roosting cave crickets in which we discern in four instars or size classes. I need to insert data on size class one into a data frame that already has data on size classes two through four. The data can be merged by their
2001 Nov 12
2
check() warnings for survival-2.6
I am not sure if this is the right place for that kind of questions, but I wondered that the recommended package survival did not pass R's check procedure without warnings: 1) unbalanced braces: * Rd files with unbalanced braces: * man/Surv.Rd * man/cluster.Rd * man/cox.zph.Rd * man/coxph.Rd * man/coxph.detail.Rd * man/date.ddmmmyy.Rd * man/lines.survfit.Rd *
2010 Dec 14
0
factor predictor using random forest
Hello everyone, I have been doing a binary classification using random forest from the library "randomForest". One of the predictors is a factor variable, which is known to be highly related to the binary response I am trying to predict. Other 80 predictors are numeric. Totally I have 44 subjects. However, the random forest returns the factor variable as the least important one based on
2013 Dec 16
1
log transforming predictor variables in a binomial GAM?
Hi all, I am applying a Presence/absence Generalized additive model to model the distribution of marine algae species in R. I have found that log transforming the environmental variables improves the explained deviance of the model considerably. While log transforming is common practice in GLM, I have been unable to find any papers where this is performed in a GAM. Im wondering whether this
2017 Dec 14
0
multiple instances of predictor variable per model
I?m running a model on animal behavior in response to shipping. In most cases, there is only one ship in the study area at one time. Ship length, distance from the animals, speed, angle from animals, and ship direction (as east/west bound) are among shipping-related covariates (with multiple interactions). The tricky part is that sometimes there are 2 ships in the area. I could add all the same
2017 Jun 29
0
Help : glm p-values for a factor predictor
Hi Michael, > -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Michael > Friendly > Sent: Thursday, June 29, 2017 9:04 AM > To: Beno?t PELE <benoit.pele at acoss.fr>; r-help at r-project.org > Subject: Re: [R] Help : glm p-values for a factor predictor > > On 6/29/17 11:13 AM, Beno?t PELE wrote: > > My question is