Click or drag to resize

MarginalEffectsParameterCalc Class

Marginal effects are use a logistic regression model to predict how changing the value of a predictor, or covariate, effects the predicted outcome. It is the slope of the regression surface with respect to a given covariate and communicates the rate at which the outcome computed by the regression model changes at a given point in covariate space, with respect to one covariate dimension and holding all covariate values constant. Marginal effects for categorical covariates, including binary covariates, are straightforward - it is simply the difference in the predicted outcomes as the the design or dummy variable's value changes from 0 to 1. For continuous valued covariates it is the derivate dy/dx where y is the models prediction function and x is the covariate we are computing the marginal effects for. Note that the marginal effect for a predictor is computed at specific observation.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreMarginalEffectsParameterCalc

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
public class MarginalEffects<ParameterCalc>
where ParameterCalc : new(), ILogisticRegressionCalc

Type Parameters

ParameterCalc
The regression model calculation object.

The MarginalEffectsParameterCalc type exposes the following members.

Constructors
 NameDescription
Public methodMarginalEffectsParameterCalc(LogisticRegressionParameterCalc) Constructs a MarginalEffects object from the given logistic regression. It is assumed that all variables are continuous - e.g. not categorical or binary.
Public methodMarginalEffectsParameterCalc(LogisticRegressionParameterCalc, ListListInt32) Constructs a MarginalEffects object from the given logistic regression which contains continuous and categorical variables.
Public methodMarginalEffectsParameterCalc(LogisticRegressionParameterCalc, ListInt32) Constructs a MarginalEffects object from the given logistic regression which contains continuous and dichotomous variables.
Public methodMarginalEffectsParameterCalc(LogisticRegressionParameterCalc, ListListInt32, ListInt32) Constructs a MarginalEffects object from the given logistic regression which contains continuous, dichotomous, and categorical variables.
Top
Properties
 NameDescription
Public propertyCategoricalVarIndices Gets the categorical parameter indices. The ith element of of the returned list contains the indices of the design variables for the ith categorical variable. CategoricalVarIndices[i][j] = the index of the jth design variable of the ith predictor.
Public propertyRegression Gets the logistic regression object.
Top
Methods
 NameDescription
Public methodAllEffects Computes the marginal effect for each predictor at each observation of the logistic regression
Public methodAverageMarginalEffects The marginal effect for a particular predictor is computed at an observation. To obtain the Average Marginal Effect (AME) for a given predictor we compute the marginal effect for each observation in the logistic regression model that self was constructed with. Then the AME for that parameter is the average of these values.
Public methodAverageMarginalEffects(DoubleVector) Computes the Average Marginal Effects using the given logistic model parameters.
Public methodEffectsAtTheMean Take vector of the means of the observation in the logistic regression and return the parameter marginal effects at this value.
Public methodMarginalEffectsAt Compute the marginal effect of the model parameters at a particular observation.
Top
See Also