[R] SMATR common slopes test

Kevin Middleton kmm at csusb.edu
Sat Nov 6 23:54:36 CET 2010


Eugenio -

> I am confused with SMATR's test for common slope. My null hypothesis here is
> that all slopes are parallel (common slopes?), right?
> So if I get a p value < 0.05 means that we can have confidence to reject it?
> That slopes are different?
> Or the other way around? it means that we have statistical confidence that
> the slopes are parallel?

Try this:

set.seed(5)
n <- 20
x <- rnorm(n)

y1 <- 2 * x + rnorm(n)
y2 <- 2 * x + rnorm(n)
y3 <- 4 * x + rnorm(n)

# Slopes approximately equal
slope.com(x = c(x, x), y = c(y1, y2), groups = rep(c(1,2), each = n))

#$p
#[1] 0.4498037

# Slopes of 2 and 4
slope.com(x = c(x, x), y = c(y1, y3), groups = rep(c(1,2), each = n))

#$p
#[1] 0.0003850332


Cheers,
Kevin

-------------------------------------------------
Kevin M. Middleton
Department of Biology
California State University San Bernardino



More information about the R-help mailing list