similar to: Specifying ANCOVA models in R

Displaying 20 results from an estimated 300 matches similar to: "Specifying ANCOVA models in R"

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
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
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)
2009 Dec 14
0
GBM package: Extract coefficients
I am using the gbm package for generalized boosted regression models, and would like 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 <-
2010 Oct 20
1
problem with predict(mboost,...)
Hi, I use a mboost model to predict my dependent variable on new data. I get the following warning message: In bs(mf[[i]], knots = args$knots[[i]]$knots, degree = args$degree, : some 'x' values beyond boundary knots may cause ill-conditioned bases The new predicted values are partly negative although the variable in the training data ranges from 3 to 8 on a numeric scale. In order to
2013 Jul 20
2
Different x-axis scales using c() in latticeExtra
Hi, I would like to combine multiple xyplots into a single, multipanel display. Using R 3.0.1 in Ubuntu, I have used c() from latticeExtra to combine three plots, but the x-axis for two plots are on a log scale and the other is on a normal scale. I also have included equispace.log=FALSE to clean up the tick labels. However, when I try all of these, the x-axis scale of the first panel is used
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,
2005 Mar 10
2
Logistic regression goodness of fit tests
I was 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
2009 Dec 10
2
different randomForest performance for same data
Hello, I came across a problem when building a randomForest model. Maybe someone can help me. I have a training- and a testdataset with a discrete response and ten predictors (numeric and factor variables). The two datasets are similar in terms of number of predictor, name of variables and datatype of variables (factor, numeric) except that only one predictor has got 20 levels in the training
2012 Sep 16
4
two questions about character manipulation
Dear all, I want to manipulate a character string such as ex<-"cbind(data$response1,data$response2)" in R in two ways: 1) extracting the "response1" portion of ex 2) replacing "$" with "." I am wondering that is it possible efficiently doing these in R? Best Ozgur -- View this message in context:
2007 Oct 30
1
Polygon shading line colors
Hi there, I'm having trouble working out how to change the colors of polygon shading lines. If I plot a polygon with polygon(poly,density=30,borders=gray(0.5)) I get gray borders but black shading lines; I have tried adding col=gray(0.5), bg=gray(0.5) and fg=gray(0.5), but no luck. How can I change the colors of the shading? The help file doesn't seem to detail this, so any
2008 Mar 21
1
hist densities
Hi there, I was wondering why x<-rnorm(n=5000,mean=1.5,sd=0.25) h<-hist(x) sum(h$density) [1] 10 I thought the integral of the histogram should be one? These seems strange to me, or am I being silly... Regards Luke Spadavecchia PS. I'm using R 2.5.1 on Mac OSX
2010 Jun 17
2
Plotting confidence intervals of two response on same graph (panel).
Hello! I would like to draw a graph like the following: http://www.optics.rochester.edu/workgroups/cml/opt307/spr04/pavel/plot_small.jpg Aim is to plot confidence intervals of treatments for X(=response1) and Y(=response2) axis simultaneously to visualize aggreement of confidence interval for two responses. Can anyone please provide me some direction to start with? Thanks! -- Kim.
2007 Oct 24
4
X11 graphics windows under CMD BATCH
Hi there, I am trying to plot some output from a FORTRAN (ifort) program using R (2.5.1) under batch mode. In the FORTRAN code, I call R in batch mode to execute a script called fig1.R using something like PROGRAM test USE IFPORT IMPLICIT NONE DO !Some function which makes an output file called ~/fortran_output.txt CALL myfunc() !System call to R plotting routine CALL SYSTEM
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
2008 Apr 25
0
hist densities
This is a reply to Luke Spadavecchia''s question about hist densities. If you want to construct a histogram where the bar heights are the percentage of observations in the intervals you can use this code: x<-rnorm(n=5000,mean=1.5,sd=0.25) h<-hist(x) h$density<-h$counts/sum(h$counts) plot(h,freq=F,ylab="Percentage") Sarah Hardy Sarah.hardy@maine.edu
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 . .
2008 Jul 16
2
Stratified random sample
An embedded and charset-unspecified text was scrubbed... Name: n?o dispon?vel URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080716/4aec957e/attachment.pl>
2010 Nov 22
1
sm.ancova graphic
Hi R-Users, I am working with sm.ancova (in the package sm) and I have two problems with the graph, which is automatically generated when sm.ancova() is run. 1-Besides of the fitted lines, the observed data appeared automatically in the graph. I prefer that only fitted lines appear. I check the sm.options, but I could not find the way that the observed data do not appear in the graph. 2-I
2009 Dec 05
0
R example for ancova
Hi list, does anybody know a easy to understand example in R which shows how to perfom an ANCOVA? I already tried to understand the example which you get when you type ?aov, but I did not really understand the output. Best, syrvn -- View this message in context: http://n4.nabble.com/R-example-for-ancova-tp949324p949324.html Sent from the R help mailing list archive at Nabble.com.