| Title: | Symmetric Linear Regression Models for Small Samples |
|---|---|
| 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>. |
| Authors: | Ivonaldo S. da Silva-Júnior [aut, cre], Francisco Moisés C. de Medeiros [aut] (ORCID: <https://orcid.org/0000-0001-6751-2666>), Eliardo Costa [aut] (ORCID: <https://orcid.org/0000-0003-4528-0379>) |
| Maintainer: | Ivonaldo S. da Silva-Júnior <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.0 |
| Built: | 2026-05-13 09:55:54 UTC |
| Source: | https://github.com/cran/SLRMss |
The Nateghi's cheese data set gives measurements of the cheddar cheese textures.
data(cheese)data(cheese)
A data frame with 16 observations on the following 4 variables.
cohe The cohesiveness.
fat The fat percentage.
xangum The xanthan gum percentage.
sodcase The sodium caseinate percentage.
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.
This function provides the coefficients of a SLRMss model.
## S3 method for class 'SLRMss' coef(object, H0 = FALSE, ...)## S3 method for class 'SLRMss' coef(object, H0 = FALSE, ...)
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. |
Coefficients extracted from the SLRMss object.
data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) coef(fit)data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) coef(fit)
This function provides an envelope plot of a fitted SLRMss model.
envplot( object, J = 100, conf = 0.95, seed = NULL, H0 = FALSE, colors = c("red", "green"), pch = 16, lty = 2, xlab, ylab, main )envplot( object, J = 100, conf = 0.95, seed = NULL, H0 = FALSE, colors = c("red", "green"), pch = 16, lty = 2, xlab, ylab, main )
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. |
Quantile-quantile plot with simulated envelope for a SLRMss object.
data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) envplot(fit)data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) envplot(fit)
This function provides the fitted values of a SLRMss model.
## S3 method for class 'SLRMss' fitted(object, H0 = FALSE, ...)## S3 method for class 'SLRMss' fitted(object, H0 = FALSE, ...)
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. |
Fitted values extracted from the SLRMss object.
data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) fitted(fit)data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) fitted(fit)
The Mirhosseini's and Tan's data set gives the measurements of the physicochemical properties of emulsion in orange drinks.
data(orange)data(orange)
A data frame with 20 observations on the following 4 variables.
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.
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.
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.
## 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"), ... )## 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"), ... )
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. |
Four diagnostic plots extracted from a SLRMss object.
data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) plot(fit)data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) plot(fit)
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.
## S3 method for class 'SLRMss' print(x, ...)## S3 method for class 'SLRMss' print(x, ...)
x |
An object of class |
... |
Currently ignored. |
Coefficients, AICc and BIC extracted from a SLRMss object.
data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) print(fit)data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) print(fit)
This function provides the residuals of a SLRMss model.
## S3 method for class 'SLRMss' residuals(object, H0 = FALSE, std = FALSE, ...)## S3 method for class 'SLRMss' residuals(object, H0 = FALSE, std = FALSE, ...)
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. |
Residuals extracted from a SLRMss object.
data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) residuals(fit)data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) residuals(fit)
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.
SLRMss(formula, family, xi, statistic, testingbeta, data)SLRMss(formula, family, xi, statistic, testingbeta, data)
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. |
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. |
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.
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)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)
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.
## S3 method for class 'SLRMss' summary(object, ...)## S3 method for class 'SLRMss' summary(object, ...)
object |
An object of class |
... |
Currently ignored. |
A selected components extracted from a SLRMss object.
data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) summary(fit)data(orange) fit <- SLRMss(emulsion ~ arabicgum + xanthangum + orangeoil, family="Student", xi=3, testingbeta="xanthangum", statistic="LR", data=orange) summary(fit)