File Exchange

image thumbnail

gmregresspi

version 1.2.0.0 (7.11 KB) by Antonio Trujillo-Ortiz
Interval Prediction of a Single Value for a Geometric Mean Regression-Reduced Major Axis Regression.

1 Download

Updated 16 Apr 2014

View Version History

View License

Model II regression should be used when the two variables in the regression equation are random and subject to error, i.e. not controlled by the researcher. Model I regression using ordinary least squares underestimates the slope of the linear relationship between the variables when they both contain error. According to Sokal and Rohlf (1995), the subject of Model II regression is one on which research and controversy are continuing and definitive recommendations are difficult to make.
GMREGRESSPI is a Model II procedure. It standardize variables before the slope is computed. Each of the two variables is transformed to have a mean of zero and a standard deviation of one. The resulting slope is the geometric mean of the linear regression coefficient of Y on X. Ricker (1973) coined this term and gives an extensive review of Model II regression. Given a comment of the Jolicoeur and Mosimann (1968) and later continued by McArdle (1988). It is also known as Standard(ized) Major Axis. In short, the OLS slope is divided by the correlation coefficient.
Friedman et al. (2013) states that, when there is no scientific reason to define one variable as dependent on the other in the usual regression sense, a method such as RMA may be more appropriate. RMA fits the line to data which minimizes the sum of the areas of the right triangles which have legs parallel to the x-axis, y-axis, and hypotenuse on the fitted line. Thus given n data points (xi,yi) and the model yi = a + bxi + ei, RMA minimizes,
i=1_Sum_n(abs((yi - (a + bxi))*(xi - ((yi - a)/b))))

Complementarily, we broadly recommend you to review the 2009 Smith's paper 'Use and Misuse of the Reduced Major Axis for Line-Fitting'.

[B,XO,YO,SE,PINT] = GMREGRESSPI(X,Y,XO,ALPHA) returns the vector B of regression coefficients in the linear Model II, XO given predictor value, YO predicted response value, SE standard error and the PINT interval prediction.

GMREGRESSPI treats NaNs in X or Y as missing values, and removes them.

If nargout is empty, it just gives the interval prediction.

Syntax: function [b,xo,yo,se,pint] = gmregresspi(x,y,xo,alpha)

Inputs:
x - independent variable vector data
y - dependent variable vector data
xo - given predictor value
alpha - significance level (default = 0.05)

Outputs:
b - regression statistics in the linear Model II
xo - given predictor value
yo - predicted response value
se - standard error
pint - interval prediction

Cite As

Antonio Trujillo-Ortiz (2021). gmregresspi (https://www.mathworks.com/matlabcentral/fileexchange/46240-gmregresspi), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!