BLS.ht {BivRegBLS} | R Documentation |

## Bivariate Least Square regression (BLS)

### Description

Estimate the heteroscedastic Bivariate Least Square regression with replicated data or variance functions.

### Usage

```
BLS.ht(data = NULL, xcol = NULL, ycol = NULL, var.x.col = NULL, var.y.col = NULL,
var.x.formula = NULL, var.y.formula = NULL, nxi.col = NULL, nyi.col = NULL,
df.var.x.col = NULL, df.var.y.col = NULL, conf.level = 0.95, pred.level = 0.95,
npoints = 1000, qx = 1, qy = 1, xpred = NULL, tol = 1e-05)
```

### Arguments

`data` |
a data set (data frame or matrix). |

`xcol` |
a numeric vector to specify the X column(s) or a character vector with the column names. |

`ycol` |
a numeric vector to specify the Y column(s) or a character vector with the column names. |

`var.x.col` |
a numeric or character variable to specify the column with the heteroscedastic variances of X. |

`var.y.col` |
a numeric or character variable to specify the column with the heteroscedastic variances of Y. |

`var.x.formula` |
a character string with a formula related to X that will be interpreted as a variance function, i.e. var.x.formula="exp(2*X+3)". |

`var.y.formula` |
a character string with a formula related to Y that will be interpreted as a variance function, i.e. var.y.formula="exp(2*Y+3)". |

`nxi.col` |
a numeric or character variable to specify the column with the number of replicates in X on which the variances were calculated. |

`nyi.col` |
a numeric or character variable to specify the column with the number of replicates in Y on which the variances were calculated. |

`df.var.x.col` |
a numeric or character variable to specify the column with the degrees of freedom of the heteroscedastic variances in X. |

`df.var.y.col` |
a numeric or character variable to specify the column with the degrees of freedom of the heteroscedastic variances in Y. |

`conf.level` |
a numeric value for the confidence level (expressed between 0 and 1). |

`pred.level` |
a numeric value for the predictive level (expressed between 0 and 1). |

`npoints` |
an integer (at least 10) for the number of points to smooth the hyperbolic curves. |

`qx` |
an integer to predict the mean of qy Y future values from the mean of qx X values (generalized interval). |

`qy` |
an integer value to predict the mean of qy Y future values from the mean of qx X values (generalized interval). |

`xpred` |
a numeric vector for customized predictions at given X values. |

`tol` |
a numeric variable to change the tolerance for the BLS to converge. |

### Details

The data argument is mandatory. If the data are unreplicated, then the measurement error variances must be given. The confidence level is used for the confidence intervals of the parameters (β, α), the hyperbolic confidence intervals (the prediction of the expectation of Y for a given X) and the hyperbolic confidence bands. The predictive level is used for the hyperbolic predictive intervals (the prediction of a future Y for a given X) and the hyperbolic generalized intervals (the prediction of the mean of qy future Y values from a given (mean of) X).

The results (`Xij`

, `Yik`

, `Xi`

, `Yi`

, `nxi`

, `nyi`

, `variances_x`

, `variances_y`

) are reordered according to the increasing values of Xi (the X mean values).

### Value

A BLS.ht class object, a list including the following elements:

`Xij` |
a table with the (replicated) X measurements (replicates are in columns). |

`Yik` |
a table with the (replicated) Y measurements (replicates are in columns). |

`Xi` |
a vector with the means of the X measurements. |

`Yi` |
a vector with the means of the Y measurements. |

`nxi` |
a vector with the number of X replicates per sample (patient). |

`nyi` |
a vector with the number of Y replicates per sample (patient). |

`variances_x` |
a vector with the variances calculated on the X replicates per sample (patient). |

`variances_y` |
a vector with the variances calculated on the Y replicates per sample (patient). |

`Ellipse.BLS.ht` |
a two columns matrix with the coordinates of the joint confidence interval (confidence region, ellipse) for the parameters (β, α). |

`Estimate.BLS.ht` |
a table (data frame) with the estimates of the intercept and the slope, standard error, confidence interval and pvalue (null hypothesis: slope = 1, intercept = 0). |

`Pred.BLS.ht` |
a data frame with npoints rows (from the minimum to the maximum of the observed X values) and the following columns: the X values where the predictions are calculated (X0), the Y predicted values (Ypred), the lower and upper bounds of the confidence interval, predictive interval, generalized interval and confidence bands. |

`xpred.BLS.ht` |
a data frame with the customized predictions and the same columns than |

### Note

The prediction interval should be interpreted with caution as it is still under development.

### Author(s)

Bernard G FRANCQ

### References

Francq BG. Errors-in-variables regressions to assess equivalence in method comparison studies. Ph.D. Thesis, Universite Catholique de Louvain, Institute of Statistics, Biostatistics and Actuarial science, Louvain-la-Neuve, Belgium, 2013.

### See Also

### Examples

```
library(BivRegBLS)
data(SBP)
res.BLS.ht=BLS.ht(data=SBP,xcol=c("J1","J2","J3"),ycol=c("S1","S2","S3"))
```

*BivRegBLS*version 1.1.1 Index]