Learn R Programming

erer (version 1.3)

maTrend: Trend of Marginal Effects

Description

This function computes the change of probability for a continuous variable, and furthermore, stratifies the probability through a binary independant variable.

Usage

maTrend(q, n = 300, nam.c, nam.d, ...)

Arguments

q
a object of class of "maBina" estimated from maBina().
n
number of points for calculating probability; the large the number, the smoother the curve.
nam.c
a name of a continuous indepedent variable; this must be given for the function to work.
nam.d
an optional name of a binary independent variable; this is used to stratify the probability.
...
additional arguments to be passed.

Value

  • Return a list object of class "maTrend" with the following components:
  • qa list object of class "maBina";
  • nam.cthe name of a continous variable;
  • mmmatrix of independant variables for all
  • trenda data frame of the continous variable and probability values; if nam.d is specificied, the data frame also contains the probability values stratified by the dummy variable;
  • nam.dif nam.d is specified, the name of a binary variable .
  • m1if nam.d is specified, the matrix of mm with the column value for nam.d replaced by 1
  • m0if nam.d is specified, the matrix of mm with the column value for nam.d replaced by 0

Details

Marginal effects are calcuated at each value of a continous variable. If specficied, the trend can be stratified by a binary independent variable.

References

Greene, W.H. 2003. Econometric Analysis (5th ed.). Prentice Hall, New York. 1026 P.

See Also

maBina; print.maTrend; plot.maTrend.

Examples

Run this code
data(daPe)
ma <- glm(grade ~ gpa + tuce + psi, x = TRUE, 
    data = daPe, family = binomial(link = "probit"))
summary(ma)

(ea <- maBina(w = ma, x.mean = TRUE, rev.dum = TRUE))
(ta <- maTrend(q = ea, nam.c = "gpa", nam.d= "psi"))
plot(ta)

Run the code above in your browser using DataLab