File Exchange

image thumbnail

bootgmregresspi

version 1.1.0.0 (9.66 KB) by Antonio Trujillo-Ortiz
Bootstrap Interval Prediction of a Single Value for a Geometric Mean Regression (RMA).

2 Downloads

Updated 16 Apr 2014

View Version History

View License

The bootstrap is a way of estimating the variability of a statistic from a single data set by resampling it independently and with equal probabilities (Monte Carlo resampling). Allows the estimation of measures where the underlying distribution is unknown or where sample sizes are small. Their results are consistent with the statistical properties of those analytical methods.
Here, we use the Non-parametric Bootstrap. Non-parametric bootstrap is simpler. It does not use the structure of the model to construct artificial data. The vector [yi, xi] is instead directly resampled with replacement. The parameters are constructed from the pairs.

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.

BOOTGMREGRESSPI is a bootstrap Model II procedure to obtaining the interval prediction of a single value for a Geometric Mean Regression (Bootstrap Reduced Major Axis Regression, RMA). It takes s bootstrap samples and 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.

Confidence intervals is a better way of describing variability when when dealing with non-normal distributions. A 95 confidence interval contains the middle 95 of the numbers in a list.

Efron and Tibshirani (1993) suggest to do 100 iterations for determination of standard error and 1000 for confidence intervals are usually adequate.

The herein Matlab bootstrap procedure is by first time developed using the statistical fundamentals given by Efron and Tibshirani (1993). Taking advantage of the bootstrp (Matlab Statistics Toolbox) and gmregresspi (http://www.mathworks.com/matlabcentral/fileexchange/46240-gmregresspi) m-functions. Plotnick (1989) gives a broad review of this procedure and it is applied to the simple allometry equation transformed into a linear regression by log-transformation of the data.

As well as Plotnick (1989) did, this Matlab procedure can be applied to other models relating to linear variables X-Y.

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,X0,BPINT] = BOOTGMREGRESSPI(S,X,Y,X0,ALPHA) returns the vector B of regression coefficients in the linear Model II, XO given predictor value, YO predicted response value and the PINT interval prediction.

BOOTGMREGRESSPI 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,pint] = bootgmregresspi(s,x,y,xo,alpha)

Inputs:
s - boot times or number of Bootstrap simulations (resamplings)
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
bpint - interval prediction

Cite As

Antonio Trujillo-Ortiz (2021). bootgmregresspi (https://www.mathworks.com/matlabcentral/fileexchange/46251-bootgmregresspi), 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!