Skip to contents

Methods for extracting information from fitted regression models objects of class unitquantreg and unitquantregs.

Usage

# S3 method for unitquantreg
print(x, digits = max(4, getOption("digits") - 3), ...)

# S3 method for unitquantreg
summary(object, correlation = FALSE, ...)

# S3 method for unitquantreg
coef(object, type = c("full", "quantile", "shape"), ...)

# S3 method for unitquantreg
vcov(object, ...)

# S3 method for unitquantreg
logLik(object, ...)

# S3 method for unitquantreg
confint(object, parm, level = 0.95, ...)

# S3 method for unitquantreg
fitted(object, type = c("quantile", "shape", "full"), ...)

# S3 method for unitquantreg
terms(x, type = c("quantile", "shape"), ...)

# S3 method for unitquantreg
model.frame(formula, ...)

# S3 method for unitquantreg
model.matrix(object, type = c("quantile", "shape"), ...)

# S3 method for unitquantreg
update(object, formula., ..., evaluate = TRUE)

# S3 method for unitquantregs
print(x, digits = max(3, getOption("digits") - 3), ...)

# S3 method for unitquantregs
summary(object, digits = max(3, getOption("digits") - 3), ...)

Arguments

digits

minimal number of significant digits.

...

additional argument(s) for methods. Currently not used.

object, x

fitted model object of class unitquantreg.

correlation

logical; if TRUE, the correlation matrix of the estimated parameters is returned and printed. Default is FALSE.

type

character indicating type of fitted values to return.

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the confidence level required.

formula

an R formula.

formula.

Changes to the formula see update.formula for details.

evaluate

If true evaluate the new call else return the call.

Value

The summary method gives Wald tests for the regressions coefficients based on the observed Fisher information matrix. As usual the summary

method returns a list with relevant model statistics and estimates, which can be printed using the print method.

The coef, vcov, confint and fitted methods can be use to extract, respectively, the estimated coefficients, the estimated covariance matrix, the Wald confidence intervals, and fitted values.

A logLik method is also provide, then the AIC

function can be use to calculated the Akaike Information Criterion.

The generic methods terms, model.frame, model.matrix, update and are also provided.

Author

André F. B. Menezes

Examples

data(sim_bounded, package = "unitquantreg")
sim_bounded_curr <- sim_bounded[sim_bounded$family == "uweibull", ]
fit_1 <- unitquantreg(formula = y1 ~ x + z + I(x^2) | z + x,
                      data = sim_bounded_curr,
                      family = "uweibull",
                      tau = 0.5, link.theta = "log")
fit_1
#> 
#> unit-Weibull quantile regression model 
#> 
#> Call:  unitquantreg(formula = y1 ~ x + z + I(x^2) | z + x, data = sim_bounded_curr, 
#>     tau = 0.5, family = "uweibull", link.theta = "log")
#> 
#> Mu coefficients (quantile model with logit link and tau = 0.5): 
#> (Intercept)            x            z       I(x^2)  
#>      1.0861       2.6523      -0.4404      -0.7293  
#> 
#> Theta coefficients (shape model with log link):
#> (Intercept)            z            x  
#>      0.5411       0.5391      -0.1054  
#> 
summary(fit_1)
#> 
#>  Wald-tests for unit-Weibull quantile regression model
#> 
#> Call:  unitquantreg(formula = y1 ~ x + z + I(x^2) | z + x, data = sim_bounded_curr, 
#>     tau = 0.5, family = "uweibull", link.theta = "log")
#> 
#> Mu coefficients: (quantile model with logit link and tau = 0.5): 
#>             Estimate Std. Error Z value Pr(>|z|)    
#> (Intercept)   1.0861     0.2107   5.155 2.54e-07 ***
#> x             2.6523     0.6779   3.913 9.12e-05 ***
#> z            -0.4404     0.2214  -1.989   0.0467 *  
#> I(x^2)       -0.7293     0.6557  -1.112   0.2660    
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> Theta coefficients (shape model with log link):
#>             Estimate Std. Error Z value Pr(>|z|)  
#> (Intercept)   0.5411     0.2372   2.281   0.0226 *
#> z             0.5391     0.3035   1.776   0.0757 .
#> x            -0.1054     0.2956  -0.356   0.7215  
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> Residual degrees of freedom: 93
#> Log-likelihood: 143.7336
#> Number of iterations: 44
vcov(fit_1)
#>                     (Intercept)             x           z      I(x^2)
#> (Intercept)          0.04439620 -0.0969196768 -0.03133869  0.07536450
#> x                   -0.09691968  0.4594902036  0.01436940 -0.42359812
#> z                   -0.03133869  0.0143693963  0.04902941 -0.01091014
#> I(x^2)               0.07536450 -0.4235981160 -0.01091014  0.42995789
#> (theta)_(Intercept) -0.02453668  0.0008140218  0.02791556  0.02046642
#> (theta)_z            0.02238187  0.0215560905 -0.04136403 -0.03394016
#> (theta)_x            0.02220360 -0.0235238444 -0.01430664 -0.00788777
#>                     (theta)_(Intercept)   (theta)_z   (theta)_x
#> (Intercept)               -0.0245366791  0.02238187  0.02220360
#> x                          0.0008140218  0.02155609 -0.02352384
#> z                          0.0279155594 -0.04136403 -0.01430664
#> I(x^2)                     0.0204664168 -0.03394016 -0.00788777
#> (theta)_(Intercept)        0.0562868809 -0.05183865 -0.05141838
#> (theta)_z                 -0.0518386501  0.09208514  0.01691677
#> (theta)_x                 -0.0514183812  0.01691677  0.08738822
coef(fit_1)
#>         (Intercept)                   x                   z              I(x^2) 
#>           1.0861165           2.6523390          -0.4403630          -0.7292936 
#> (theta)_(Intercept)           (theta)_z           (theta)_x 
#>           0.5411322           0.5390803          -0.1053611 
confint(fit_1)
#>                           2.5 %       97.5 %
#> (Intercept)          0.67314412  1.499088820
#> x                    1.32376360  3.980914474
#> z                   -0.87434970 -0.006376292
#> I(x^2)              -2.01446504  0.555877761
#> (theta)_(Intercept)  0.07613358  1.006130855
#> (theta)_z           -0.05568122  1.133841819
#> (theta)_x           -0.68475582  0.474033656
terms(fit_1)
#> y1 ~ x + z + I(x^2)
#> attr(,"variables")
#> list(y1, x, z, I(x^2))
#> attr(,"factors")
#>        x z I(x^2)
#> y1     0 0      0
#> x      1 0      0
#> z      0 1      0
#> I(x^2) 0 0      1
#> attr(,"term.labels")
#> [1] "x"      "z"      "I(x^2)"
#> attr(,"order")
#> [1] 1 1 1
#> attr(,"intercept")
#> [1] 1
#> attr(,"response")
#> [1] 1
#> attr(,".Environment")
#> <environment: 0x55ae06850f78>
model.frame(fit_1)[1:5, ]
#>          y1          x         z       I(x^2)
#> 1 0.8437491 0.18696902 0.2260138 0.034957....
#> 2 0.9381423 0.98263057 0.5747853 0.965562....
#> 3 0.8565817 0.08645855 0.5068224 0.007475....
#> 4 0.8166633 0.34691893 0.7821340 0.120352....
#> 5 0.9019195 0.80975514 0.2091639 0.655703....
model.matrix(fit_1)[1:5, ]
#>   (Intercept)          x         z      I(x^2)
#> 1           1 0.18696902 0.2260138 0.034957415
#> 2           1 0.98263057 0.5747853 0.965562828
#> 3           1 0.08645855 0.5068224 0.007475081
#> 4           1 0.34691893 0.7821340 0.120352745
#> 5           1 0.80975514 0.2091639 0.655703385
update(fit_1, . ~ . -x)
#> 
#> unit-Weibull quantile regression model 
#> 
#> Call:  unitquantreg(formula = y1 ~ z + I(x^2) | z + x, data = sim_bounded_curr, 
#>     tau = 0.5, family = "uweibull", link.theta = "log")
#> 
#> Mu coefficients (quantile model with logit link and tau = 0.5): 
#> (Intercept)            z       I(x^2)  
#>      1.7231      -0.5780       1.5967  
#> 
#> Theta coefficients (shape model with log link):
#> (Intercept)            z            x  
#>      0.3233       0.4236       0.2801  
#> 
update(fit_1, . ~ . -z)
#> 
#> unit-Weibull quantile regression model 
#> 
#> Call:  unitquantreg(formula = y1 ~ x + I(x^2) | z + x, data = sim_bounded_curr, 
#>     tau = 0.5, family = "uweibull", link.theta = "log")
#> 
#> Mu coefficients (quantile model with logit link and tau = 0.5): 
#> (Intercept)            x       I(x^2)  
#>      0.8264       2.7114      -0.7228  
#> 
#> Theta coefficients (shape model with log link):
#> (Intercept)            z            x  
#>      0.7754       0.1707      -0.2514  
#> 
update(fit_1, . ~ . -I(x^2))
#> 
#> unit-Weibull quantile regression model 
#> 
#> Call:  unitquantreg(formula = y1 ~ x + z | z + x, data = sim_bounded_curr, 
#>     tau = 0.5, family = "uweibull", link.theta = "log")
#> 
#> Mu coefficients (quantile model with logit link and tau = 0.5): 
#> (Intercept)            x            z  
#>      1.1978       1.9432      -0.4399  
#> 
#> Theta coefficients (shape model with log link):
#> (Intercept)            z            x  
#>      0.5822       0.4597      -0.1241  
#> 
update(fit_1, . ~ . | . -z)
#> 
#> unit-Weibull quantile regression model 
#> 
#> Call:  unitquantreg(formula = y1 ~ x + z + I(x^2) | x, data = sim_bounded_curr, 
#>     tau = 0.5, family = "uweibull", link.theta = "log")
#> 
#> Mu coefficients (quantile model with logit link and tau = 0.5): 
#> (Intercept)            x            z       I(x^2)  
#>      0.9562       2.4672      -0.1824      -0.4387  
#> 
#> Theta coefficients (shape model with log link):
#> (Intercept)            x  
#>      0.8457      -0.2332  
#> 
update(fit_1, . ~ . | . -x)
#> 
#> unit-Weibull quantile regression model 
#> 
#> Call:  unitquantreg(formula = y1 ~ x + z + I(x^2) | z, data = sim_bounded_curr, 
#>     tau = 0.5, family = "uweibull", link.theta = "log")
#> 
#> Mu coefficients (quantile model with logit link and tau = 0.5): 
#> (Intercept)            x            z       I(x^2)  
#>      1.1156       2.6265      -0.4622      -0.7422  
#> 
#> Theta coefficients (shape model with log link):
#> (Intercept)            z  
#>      0.4766       0.5634  
#>