# Example 1 (surgical unit data) data ( mod2ex1 ) Ex1.res <- lmodel2 ( Predicted_by_model ~ Survival, data = mod2ex1, nperm = 99 ) Ex1.res plot ( Ex1.res ) # Example 2 (eagle rays and Macomona) data ( mod2ex2 ) Ex2.res <- lmodel2 ( Prey ~ Predators, data = mod2ex2, "relative", "relative", 99 ) Ex2.res op <- par ( mfrow = c ( 1, 2 )) plot ( Ex2.res, "SMA" ) plot ( Ex2.res, "RMA" ) par ( op ) # Example 3 (cabezon spawning) op <- par ( mfrow = c ( 1, 2 )) data ( mod2ex3 ) Ex3.res <- lmodel2 ( No_eggs ~ Mass, data = mod2ex3, "relative", "relative", 99 ) Ex3.res plot ( Ex3.res, "SMA" ) plot ( Ex3.res, "RMA" ) par ( op ) # Example 4 (highly correlated random variables) op <- par ( mfrow = c ( 1, 2 )) data ( mod2ex4 ) Ex4.res <- lmodel2 ( y ~ x, data = mod2ex4, "interval", "interval", 99 ) Ex4.res plot ( Ex4.res, "OLS" ) plot ( Ex4.res, "MA" ) par ( op ) # Example 5 (uncorrelated random variables) data ( mod2ex5 ) Ex5.res <- lmodel2 ( random_y ~ random_x, data = mod2ex5, "interval", "interval", 99 ) Ex5.res op <- par ( mfrow = c ( 2, 2 )) plot ( Ex5.res, "OLS" ) plot ( Ex5.res, "MA" ) plot ( Ex5.res, "SMA" ) plot ( Ex5.res, "RMA" ) par ( op ) # Example 6 where cor(y,x) = 0 by construct (square grid of points) y0 = rep ( c ( 1, 2, 3, 4, 5 ), 5 ) x0 = c ( rep ( 1, 5 ), rep ( 2, 5 ), rep ( 3, 5 ), rep ( 4, 5 ), rep ( 5, 5 )) plot ( x0, y0 ) E圆 = as.ame ( cbind ( x0, y0 )) zero.res = lmodel2 ( y0 ~ x0, data = E圆, "relative", "relative" ) print ( zero.res ) op <- par ( mfrow = c ( 1, 2 )) plot ( zero.res, "OLS" ) plot ( zero.res, "MA" ) par ( op ) # The example data files are described in more detail in the # \dQuote tutorial. With this function, and can be read within R session using command 3rdĪ tutorial (file “Model II User's guide, R edition”) is provided Practice of statistics in biological research. Pierre Legendre, Departement de Sciences Biologiques, Universite de Montreal References Internal functions that performĮssential parts of the analysis are MA.reg, SMA.reg,ĬLma, CLsma and permutest.lmodel2. Much of the work isĭone by internal functions which are not directly visible, but youĬan use triple colon to see or directly use these functions (e.g., The package exports only the main functions lmodel2, Information about the confidence limits notation Information about the slope notation when r = 0. Number of permutations for the permutation tests.Īny value smaller than epsilon is considered to be zero. Notation following Sokal and RohlfĬoefficient of determination (R-square) of the OLS regression.Ģ-tailed parametric P-value for the test of r and the OLS slope.Īngle between the two OLS regression lines, The H statistic used for computing the confidence (one-tailed, for the tail corresponding to the sign of the slope Line and the abscissa, and the permutational probability The intercept and slope estimates, the angle between the regression Column 1 gives the method name, followed by Information from a list, produced by function lmodel2, whichįour regression methods. The default output provides the regression output. Method="SMA", or method="RMA", and its 95 percent confidence interval. Regression lines, specified by method="OLS", method="MA" (default), The plot function plots the data points together with one of the Provided with this function contains a tutorial for model II
The PDF document “Model II User's guide, R edition”
OLS, MA, and SMA are also described in Sokal and Rohlf (RMA) are described in Legendre and Legendre (1998, Sectionġ0.3.2). Major axis (MA), standard major axis (SMA), and ranged major axis The model II regression methods of ordinary least squares (OLS), II User's guide, R edition” which you can read using command In some cases as a model II regression model see the “Model Ordinary least squares (OLS) is, however, appropriate The slope of the linear relationship between the variables when theyīoth contain error. Model I regression using least squares underestimates Model II regression should be used when the two variables in the Variable x possibly includes negative values (interval-scale If range.x = "relative": variable x has a Y possibly includes negative values (interval-scale If range.y = "relative": variable y has a true zero If only one of them is NULL, the program will stop. If range.y = NULL and range.x = NULL, RMA will Parametres for ranged major axis regression Lmodel2 ( formula, data = NULL, range.y = NULL, range.x = NULL, nperm = 0 )Ī formula specifying the bivariate model, as inĪ data frame containing the two variables specified in the formula.