Description Usage Arguments Details Value Author(s) References See Also Examples
frm
is used to fit fractional regression models, i.e. regression models for proportions, percentages or fractions.
1 2 3 |
y |
a numeric vector containing the values of the response variable. |
x |
a numeric matrix, with column names, containing the values of the covariates. |
x2 |
a numeric matrix, with column names, containing the values of the covariates in the fractional component of two-part
models if option |
linkbin |
a description of the link function to use in the binary component of a two-part fractional regression model.
Available options: |
linkfrac |
a description of the link function to use in standard fractional regression models or in the fractional component
of a two-part fractional regression model. Available options: |
type |
a description of the model to estimate: a standard one-part model ( |
inflation |
a numeric value indicating which of the extreme values of |
intercept |
a logical value indicating whether the model should include a constant term or not. |
table |
a logical value indicating whether a summary table with the regression results should be printed. |
variance |
a logical value indicating whether the variance of the estimated parameters should be calculated. Defaults to
|
var.type |
a description of the type of variance of the estimated parameters to be calculated. Options are |
var.eim |
a logical value indicating whether the expected information matrix should be used in the calculation of the variance. When
false, the observation information matrix will be used. Defaults to |
var.cluster |
a numeric vector containing the values of the variable that specifies to which cluster each observation belongs. |
dfc |
a logical value indicating whether a degrees of freedom correction should be applied to the covariance matrix. Defaults to
|
... |
Arguments to pass to glm. |
frm
estimates one- and two-part fractional regression models; see
Ramalho, Ramalho and Murteira (2011) for details on those models. The one-part
models and the fractional component of two-part models are estimated by
Bernoulli-based quasi-maximum likelihood, while the binary component of
two-part models is estimated by maximum likelihood. frm
uses the standard
glm command to perform the estimations. Therefore,
frm
is essentially a convenience command, allowing estimation of several
alternative fractional regression models using the same command. In addition,
frm
provides an R-squared measure for all models (calculated as the square
of the correlation coefficient between the actual and fitted values of the
dependent variable), calculates the fitted values of the dependent variable in
two-part models and stores the information needed to implement some very useful
commands for fractional regression models: frm.reset (RESET test),
frm.ptest (P test), frm.ggoff (GGOFF tests) and frm.pe
(partial effects).
When type = "1P" or "2Pfrac"
, frm
returns a list with the following elements:
class |
"frm". |
formula |
the model formula. |
type |
the name of the estimated model. |
link |
the name of the specified link. |
method |
estimation method. Currently, "QML" (quasi-maximum likelihood) for fractional components or models and "ML" (maximum likelihood) for the binary component of two-part models. |
p |
a named vector of coefficients. |
yhat |
the fitted mean values. |
xbhat |
the fitted mean values of the linear predictor. |
converged |
logical. Was the algorithm judged to have converged? |
x.names |
a vector containing the names of the covariates. |
If variance = TRUE
or table = TRUE
, the previous list also contains the following elements:
p.var |
a named covariance matrix. |
var.type |
covariance matrix type. |
var.eim |
logical. Was the expected information matrix used in the computation of the covariance matrix? |
dfc |
logical. Was a degrees of freedom correction used for the computation of the covariance matrix? |
If var.type = "cluster"
, the list also contains the following element:
var.cluster |
the variable that specifies to which cluster each observation belongs. |
When type = "2Pbin"
, frm
returns a similar list with the following additional element:
LL |
the value of the log-likelihood. |
When type = "2P"
, frm
returns the previous lists, indexed by the prefixes resBIN
and
resFRAC
, and the following additional elements:
class |
"frm". |
type |
"2P". |
ybase |
a numeric vector containing the values of the response variable. |
x2base |
a numeric matrix containing the values of the covariates. |
yhat2P |
the overall fitted mean values. |
converged |
logical. Were the algorithms judged to have converged in both parts of the model? |
Joaquim J.S. Ramalho <jsr@uevora.pt>
Ramalho, E.A., J.J.S. Ramalho and J.M.R. Murteira (2011), "Alternative estimating and testing empirical strategies for fractional regression models", Journal of Economic Surveys, 25(1), 19-68.
frm.reset
and frm.ggoff
, for specification tests.
frm.ptest
, for non-nested hypothesis tests.
frm.pe
, for computing partial effects.
frmhet
, for fitting cross-sectional fractional regression models with unobserved heterogeneity.
frmpd
, for fitting panel data fractional regression models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | N <- 250
u <- rnorm(N)
X <- cbind(rnorm(N),rnorm(N))
dimnames(X)[[2]] <- c("X1","X2")
ym <- exp(X[,1]+X[,2]+u)/(1+exp(X[,1]+X[,2]+u))
y <- rbeta(N,ym*20,20*(1-ym))
y[y > 0.9] <- 1
#frm estimation of a logit fractional regression model
frm(y,X,linkfrac="logit")
#frm estimation of the binary logit component of the two-part fractional
#regression model with y=1 as the relevant boundary value
frm(y,X,linkbin="logit",type="2Pbin",inf=1)
#frm estimation of the fractional component of the two-part fractional
#regression model with y=1 as the relevant boundary value and using a
#probit link function
frm(y,X,linkfrac="probit",type="2Pfrac",inf=1)
#frm estimation of both components of a two-part fractional regression model
#with y=1 as the relevant boundary value and using a cloglog binary link
#function and a logit fractional link function
frm(y,X,linkbin="cloglog",linkfrac="logit",type="2P",inf=1)
## See the website http://evunix.uevora.pt/~jsr/FRM.htm for more examples.
|
*** Fractional logit regression model ***
Estimate Std. Error t value Pr(>|t|)
INTERCEPT 0.024508 0.064474 0.380 0.704
X1 0.841290 0.071808 11.716 0.000 ***
X2 0.892033 0.067770 13.163 0.000 ***
Note: robust standard errors
Number of observations: 250
R-squared: 0.611
*** Binary component of a two-part model - logit specification ***
Estimate Std. Error t value Pr(>|t|)
INTERCEPT -3.482028 0.461986 -7.537 0.000 ***
X1 1.810048 0.337835 5.358 0.000 ***
X2 1.619908 0.310407 5.219 0.000 ***
Number of observations: 250
R-squared: 0.364
*** Fractional component of a two-part model - probit specification ***
Estimate Std. Error t value Pr(>|t|)
INTERCEPT -0.082723 0.035126 -2.355 0.019 **
X1 0.408120 0.038610 10.570 0.000 ***
X2 0.452344 0.037239 12.147 0.000 ***
Note: robust standard errors
Number of observations: 217
R-squared: 0.532
*** Binary component of a two-part model - cloglog specification ***
Estimate Std. Error t value Pr(>|t|)
INTERCEPT -3.383568 0.401618 -8.425 0.000 ***
X1 1.566504 0.267828 5.849 0.000 ***
X2 1.360024 0.225276 6.037 0.000 ***
Number of observations: 250
R-squared: 0.37
*** Fractional component of a two-part model - logit specification ***
Estimate Std. Error t value Pr(>|t|)
INTERCEPT -0.136027 0.058256 -2.335 0.020 **
X1 0.665547 0.064867 10.260 0.000 ***
X2 0.739571 0.063858 11.582 0.000 ***
Note: robust standard errors
Number of observations: 217
R-squared: 0.53
*** Two-part model - binary cloglog + fractional logit ***
R-squared: 0.352
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.