Displaying 20 results from an estimated 10000 matches similar to: "abline by groups"
2010 Apr 01
2
Adding regression lines to each factor on a plot when using ANCOVA
Dear R users,
i'm using a custom function to fit ancova models to a dataset. The data are
divided into 12 groups, with one dependent variable and one covariate. When
plotting the data, i'd like to add separate regression lines for each group
(so, 12 lines, each with their respective individual slopes). My 'model1'
uses the group*covariate interaction term, and so the coefficients
2011 Dec 11
2
multiple comparison of interaction of ANCOVA
Hi there,
The following data is obtained from a long-term experiments.
> mydata <- read.table(textConnection("
+ y year Trt
+ 9.37 1993 A
+ 8.21 1995 A
+ 8.11 1999 A
+ 7.22 2007 A
+ 7.81 2010 A
+ 10.85 1993 B
+ 12.83 1995 B
+ 13.21 1999 B
+ 13.70 2007 B
+ 15.15 2010 B
+ 5.69 1993 C
+ 5.76 1995 C
+ 6.39 1999
2012 Apr 18
3
how to plot separate lm ablines on the same xyplot by group
Hi,
I am trying to use xyplot to plot the relationship between size and day
(y~x) by a food factor that has two levels, low and high. I have 3 reps per
factor/day. I want the plots from each food treatment on the same axiss,
so I used this code:
xyplot(Size ~ Day, groups = Food, data = louis.data.means,col=1,
pch=c(1,17),
panel=function(x,y,groups,...){
panel.superpose(x,y,groups,...)
2010 Mar 06
2
Plot interaction in multilevel model
I am trying to plot an interaction in a multilevel model. Here is some
sample data. In the following example, it is longitudinal (i.e., repeated
measures), so the outcome, score (at each of the three time points), is
nested within the individual. I am interested in the interaction between
gender and happiness predicting score.
id <- c(1,1,1,2,2,2,3,3,3)
age <-
2008 Feb 21
2
coloring a graph left or right of an abline
Dear R community,
I would wish to color the background of my histogram differently to the
left and right of an abline... Can you please help?
Thankin you,
Georg.
****************************
Georg Ehret
JHU
Baltimore - USA
[[alternative HTML version deleted]]
2010 Nov 27
1
How to add multiple ablines
Hi folks
Run;
> ToothGrowth
> attach(ToothGrowth)
> toothgrowth=lm(len~dose)
adding abline:
> abline(toothgrowth)
I got it done adding single abline.
How to add more ablines on the same diagram?
I found following thread, applying "mapply" command;
Plotting multiple ablines
http://www.mail-archive.com/r-help@r-project.org/msg51543.html
mapply(abline,
(converge$kY +
2016 Apr 09
1
Quantmod abline and axis configuration
Hi all,
I have this code
I want to add two ablines like this
abline(h=2400, lty=3, col="lightgrey")
abline(h=400, lty=3, col="lightgrey")
But doesnt wotk.
I alo try to set ylim from 0 to max "Foa"+1000 but I?m not able ?Is it
posible?
require(latticeExtra)
require(ggplot2)
require(reshape2)
suppressPackageStartupMessages(require(googleVis))
require(quantmod)
2011 May 03
2
Controlling the extent of ablines on plot
Hi all,
I'm attempting to make a quite-specific plot where the axes cross at the
origin and with gridlines for guidance. I've been using ablines to create
the reference lines because I want a lot of control as to where they are
placed on the axis. This command works very well for such control.
However...
These ablines don't seem to work when I specify the origin as 0,0. They go
2011 Mar 31
2
ANCOVA for linear regressions without intercept
Hello R experts
I have two linear regressions for sexes (Male, Female, Unknown). All have a good correlation between body length (response variable) and head length (explanatory variable). I know it is not recommended, but for a good practical reason (the purpose of study is to find a single conversion factor from head length to body length), the regressions need to go through the origin (0
2010 May 11
2
ANCOVA in R, single CoVar, two Variables
Hello,
I am VERY new to R, just picking it up infact. I have got my head around the
basics of ANOVA with post hoc tests but I am struggling with regression,
especially with ANCOVAs.
I have two sets of data, one of type A, one of type B. Both have been placed
in a wind tunnel and sampled every week. The co variate is of course the
days since the start.
An example is
day A B
0 10.0 10.0
7 9.0
2018 Jan 29
2
Add ablines
Good morning,
I have some problem adding ablines in Rstudio.
The lines drew by the software doesen?t match with the added values, what can I do?
pfaOK<-qcc(D[!trial], sizes=size[!trial], type="p", nsigmas=2, data.name="Polli positivi al Campylobacter")
pfaOK1<-qcc(D[!trial], sizes=size[!trial], type="p", data.name="Polli positivi al Campylobacter")
2007 Jan 09
2
posthoc tests with ANCOVA
dear all,
I want to perform a posthoc test for my ANCOVA:
a1<-aov(seeds~treatment*length)
With
summary(glht(a1, linfct = mcp(treatment = "Tukey")))
R tells me: "covariate interactions found -- please choose appropriate
contrast"
How do I build these contrasts?
Ideally, I would like to have the posthoc test for the ANCOVA including
a block-effect
2011 Aug 10
1
Using ANCOVA in R
Hello,
I have a problem with using the following design with ANCOVA in R.
There are two groups (control + treatment), each with ten subjects.
The subjects show a response that is monitored over time (four time
points). For a single given subject, the response can be analysed with
linear regression with time as the independent variable.
The question is, how does the response differ between the
2010 Jun 22
2
xyplot: adding pooled regression lines to a paneled type="r" plot
Consider the following plot that shows separate regression lines ~ age
for each subject in the Pothoff-Roy Orthodont data,
with separate panels by Sex:
library(nlme)
#plot(Orthodont)
xyplot(distance ~ age|Sex, data=Orthodont, type='r', groups=Subject,
col=gray(.50),
main="Individual linear regressions ~ age")
I'd like to also show in each panel the pooled OLS
2007 Aug 02
4
warning messages in grid or lattice give that I can't debug
The messages are visible in 2.6.0dev
The same commands in 2.4.1 work without warning messages.
I am using the HH_1.18-1 from R_2.4.1 with both R versions and not
the current HH_2.1-3
version$version.string
installed.packages()[c("grid","lattice", "HH"),3]
## library(HH)
library(lattice, lib.loc="C:/PROGRA~1/R/R-2.4.1/library")
hotdog <-
2010 Sep 13
1
shade area between 'ablines'
Hi, want to shade the area between dotted lines:
x=c(1,5);y=c(1,5)
plot(y~x, type='n')
abline(v=c(2,3), lty=2)
sometnig simple needed. tried with polygon....
thx, robert
--
View this message in context: http://r.789695.n4.nabble.com/shade-area-between-ablines-tp2537352p2537352.html
Sent from the R help mailing list archive at Nabble.com.
2008 May 16
1
xyplot: subscripts, groups and subset
I have stumbled across something in the Lattice package that is vexing me.
Consider the code below:
__________________________________________________________
library(lattice)
myData <- expand.grid(sub = factor(1:16), time = 1:10)
myData$observed <- rnorm(nrow(myData))
myData$fitted <- with(myData, ave(observed, sub, FUN = mean))
myData$event.time <- with(myData, ave(observed, sub,
2012 Feb 12
2
ANCOVA post-hoc test
Could you please help me on the following ANCOVA issue?
This is a part of my dataset:
sampling dist h
1 wi 200 0.8687212
2 wi 200 0.8812909
3 wi 200 0.8267464
4 wi 0 0.8554508
5 wi 0 0.9506721
6 wi 0 0.8112781
7 wi 400 0.8687212
8 wi 400 0.8414646
9 wi 400 0.7601675
10 wi 900 0.6577048
11 wi 900
2010 Dec 26
2
Doing a mixed-ANOVA after accounting for a covariate
Dear r helpers,
I would like to look at the interaction between two two-level factors, one
between and one within participants, after accounting for any variance due
to practice (31 trials in each of two blocks) in the task.
It seems to require treating practice as a covariate.
All the examples I noticed for handling covariates (i.e. ANCOVA, including
the ones in Faraway's "Practical
2013 Mar 13
1
multi-comparison of means
Hi all:
I have a question about multi-comparison.
The data is in the attachment.
My purpose:
Compare the predicted means of the 3 methods(a,b,c) pairwisely.
I have 3 ideas:
#idea1
result_aov<-aov(y~ method + x1 + x2)
TukeyHSD(result_aov)
diff lwr upr p adj
b-a 0.845 0.5861098 1.1038902 0.0000001
c-a 0.790 0.5311098 1.0488902 0.0000002
c-b -0.055 -0.3138902