Title: | Symmetric Linear Regression Models for Small Samples |
Version: | 1.0.0 |
Description: | Ordinary and modified statistics for symmetrical linear regression models with small samples. The supported ordinary statistics include Wald, score, likelihood ratio and gradient. The modified statistics include score, likelihood ratio and gradient. Diagnostic tools associated with the fitted model are implemented. For more details see Medeiros and Ferrari (2017) <doi:10.1111/stan.12107>. |
License: | GPL-3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Imports: | methods, normalp, ssym |
NeedsCompilation: | no |
Packaged: | 2025-07-06 15:25:48 UTC; eliardocosta |
Author: | Ivonaldo S. da Silva-Júnior [aut, cre],
Francisco Moisés C. de Medeiros
|
Maintainer: | Ivonaldo S. da Silva-Júnior <ivosilvestresjr@gmail.com> |
Depends: | R (≥ 3.5.0) |
Repository: | CRAN |
Date/Publication: | 2025-07-09 13:20:02 UTC |
Symmetric Linear Regression Models for small samples
Description
Computes Wald, Likelihood Ratio, Score, or Gradient statistics for symmetric linear regression models. Also computes modified versions of the Likelihood Ratio, Score, and Gradient tests for small sample sizes.
Usage
SLRMss(formula, family, xi, statistic, testingbeta, data)
Arguments
formula |
An object of class |
family |
A description of the error distribution to be used in the model. There are four supported families, Normal, t-Student, Power Exponential and Logistic ("Normal", "Student", "Powerexp" and "Logistic", respectively) |
xi |
An extra parameter of some specified error distribution. For t-Student is a positive value and for Power Exponential is a real number between -1 and 1/3. |
statistic |
The statistic which will be used. It includes "Wald", "LR", "Score" or "Gradient". |
testingbeta |
A vector containing the names of the variables to be testing. |
data |
An optional data frame containing the variables in the model. |
Value
A list with the following components
beta.coefficients |
A matrix with the estimated position parameters under alternative hypothesis. |
phi |
A numeric value with the estimated precision paramater under alternative hypothesis. |
beta.coefficients.h0 |
A matrix with the estimated position parameters under null hypothesis. |
phi.h0 |
A numeric value with the estimated precision paramater under null hypothesis. |
y.fitted |
A vector with the fitted values of the model. |
null.hypothesis |
The description of the null hypothesis. |
statistics |
A matrix with the selected statistics and theirs p-values. The corrected statistic is marked with an asterisk. |
statistic.distribution |
The name of the statistics' distribution used to test null hypothesis. It always return "Chi-Squared". |
df |
The degrees of freedom of the statistics' distribution. It's the length of the testingbeta vector. |
residuals |
The difference among the real y values and the fitted y. |
std.residuals |
The residuals divided by the precision parameter |
AICc |
The corrected Akaike Information Criterion for small samples. |
BIC |
The Bayesian Information Criterion. |
References
Medeiros, F. M. C and Ferrari, S. L. P. (2017). Small-sample testing inference in symmetric and log-symmetric linear regression models, Statistica Neerlandica. doi:10.1111/stan.12107.
Examples
data(orange)
fit1 <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student",
xi=3, testingbeta="xanthangum", statistic="LR", data=orange)
print(fit1)
data(cheese)
fit2 <- SLRMss(cohe ~ fat + xangum + sodcase, family="Normal",
testingbeta=c("xangum","sodcase"), statistic="Gradient", data=cheese)
print(fit2)
Cheese data set
Description
The Nateghi's cheese data set gives measurements of the cheddar cheese textures.
Usage
data(cheese)
Format
A data frame with 16 observations on the following 4 variables.
Details
cohe The cohesiveness.
fat The fat percentage.
xangum The xanthan gum percentage.
sodcase The sodium caseinate percentage.
Source
Nateghi, L., Roohinejad, S., Totosaus, A., Mirhosseini, H., Shuhaimi, M., Meimandipour, A., Omidizadeh, A., Manap, M.Y.A. (2012). Optimization of textural properties and formulation of reduced fat Cheddar cheeses containing fat replacers. Journal of Food, Agriculture & Environment, 10(2), 46-54.
Extract the model coefficients for a SLRMss object
Description
This function provides the coefficients of a SLRMss
model.
Usage
## S3 method for class 'SLRMss'
coef(object, H0 = FALSE, ...)
Arguments
object |
An object of class |
H0 |
If TRUE, choose the coefficients under the null hypothesis, if FALSE, choose the coefficients under alternative hypothesis (default). |
... |
Currently ignored. |
Value
Coefficients extracted from the SLRMss object.
Examples
data(orange)
fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student",
xi=3, testingbeta="xanthangum", statistic="LR", data=orange)
coef(fit)
Quantile-quantile plots with simulated envelope of residuals for SLRMss objects
Description
This function provides an envelope plot of a fitted SLRMss model.
Usage
envplot(
object,
J = 100,
conf = 0.95,
seed = NULL,
H0 = FALSE,
colors = c("red", "green"),
pch = 16,
lty = 2,
xlab,
ylab,
main
)
Arguments
object |
An object of class |
J |
The number of Monte Carlo replications. 100 by default. |
conf |
The confidence level. 0.95 by default. |
seed |
An optional seed for the simulation. |
H0 |
If TRUE, choose the fitted values under null hypothesis, if FALSE, choose the fitted values under alternative hypothesis (default). |
colors |
A vector with one or two characters. If it has one character, that represents the color of the plotted points. If it has two characters, the first one represents the color of the points out of the limits and the second one represents the color of the points under the limits. Red and green by default. |
pch |
A vector with one or two numbers. If it has one numeric, that represents the plot |
lty |
A vector with one or two numbers. If it has one number, that represents the |
xlab |
A title for the x axis. |
ylab |
A title for the y axis. |
main |
A title for the plot. |
Value
Quantile-quantile plot with simulated envelope for a SLRMss object.
Examples
data(orange)
fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student",
xi=3, testingbeta="xanthangum", statistic="LR", data=orange)
envplot(fit)
Extract model fitted values for a SLRMss object
Description
This function provides the fitted values of a SLRMss model.
Usage
## S3 method for class 'SLRMss'
fitted(object, H0 = FALSE, ...)
Arguments
object |
An object of class |
H0 |
If TRUE, choose the fitted values under null hypothesis, if FALSE, choose the fitted values under alternative hypothesis (default). |
... |
Currently ignored. |
Value
Fitted values extracted from the SLRMss object.
Examples
data(orange)
fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3,
testingbeta="xanthangum", statistic="LR", data=orange)
fitted(fit)
Orange data Set
Description
The Mirhosseini's and Tan's data set gives the measurements of the physicochemical properties of emulsion in orange drinks.
Usage
data(orange)
Format
A data frame with 20 observations on the following 4 variables.
Details
emulsion The emulsion density in g/cm3.
arabicgum The arabic gum quantity in g.
xanthangum The xanthan gum quantity in g.
orangeoil The orange oil quantity in g.
Source
Mirhosseini, H., Tan, C.P. (2010). Discrimination of orange beverage emulsions with different formulations using multivariate analysis. Journal of the Science of Food and Agriculture, 90, 1308-1316.
Diagnostic plots for SLRMss objects
Description
This function provides four plot for residual analysis. The first plot shows the standardized residuals against the fitted values. The second one shows the standardized residuals against by their index. The third one presents QQ-normal plot of them and the last one shows their density estimate.
Usage
## S3 method for class 'SLRMss'
plot(
x,
H0 = FALSE,
xlab = c("Fitted Values", "Index", "Theoretical Quantiles", "Standardized Residuals"),
ylab = c("Standardized Residuals", "Standardized Residuals", "Standardized Residuals",
"Density"),
main = c("Residuals Against Fitted Values", " Residuals Against Index",
"Normal Q-Q Plot", "Density Estimate"),
...
)
Arguments
x |
An object of class |
H0 |
If TRUE, plot the graphics under null hypothesis, if FALSE, plot the graphics under alternative hypothesis (default). |
xlab |
A vector containing the four x-axis titles. |
ylab |
A vector containing the four y-axis titles. |
main |
A vector containing the four main plot titles. |
... |
Currently ignored. |
Value
Four diagnostic plots extracted from a SLRMss object.
Examples
data(orange)
fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student",
xi=3, testingbeta="xanthangum", statistic="LR", data=orange)
plot(fit)
Print values of a SLRMss object
Description
This function displays a succinct summary of the fitted model. It includes the mean and dispersion parameter estimates, corrected Akaike information criterion and Bayesian information criterion.
Usage
## S3 method for class 'SLRMss'
print(x, ...)
Arguments
x |
An object of class |
... |
Currently ignored. |
Value
Coefficients, AICc and BIC extracted from a SLRMss object.
Examples
data(orange)
fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3,
testingbeta="xanthangum", statistic="LR", data=orange)
print(fit)
Extract residuals model for SLRMss objects
Description
This function provides the residuals of a SLRMss model.
Usage
## S3 method for class 'SLRMss'
residuals(object, H0 = FALSE, std = FALSE, ...)
Arguments
object |
An object of class |
H0 |
If TRUE, choose the residuals under null hypothesis, if FALSE, choose the residuals under alternative hypothesis (default). |
std |
If TRUE, choose the standardized residuals, if FALSE, choose the non-standardized residuals (default). |
... |
Currently ignored. |
Value
Residuals extracted from a SLRMss object.
Examples
data(orange)
fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student",
xi=3, testingbeta="xanthangum", statistic="LR", data=orange)
residuals(fit)
SLRMss object summaries
Description
This function displays the summary of the fitted model. It includes parameter estimates under both, null and alternative hypothesis, corrected Akaike information criterion, bayesian information criterion and choosed statistics.
Usage
## S3 method for class 'SLRMss'
summary(object, ...)
Arguments
object |
An object of class |
... |
Currently ignored. |
Value
A selected components extracted from a SLRMss object.
Examples
data(orange)
fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student",
xi=3, testingbeta="xanthangum", statistic="LR", data=orange)
summary(fit)