A wrapper of glm, this function estimates a lagged regression model of adoption as a function of exposure and other controls as especified by the user.
diffreg(model, type = c("logit","probit"))
Arguments
model: An object of class formula where the right-hand-side is an object of class diffnet
type: Character scalar. Either "probit" or "logit".
Where exposure can be especified either as a simple term, or as a call to the exposure function, e.g. to compute exposure with a lag of length 2, the formula could be:
When no argument is passed to exposure, the function sets a lag
of length 1 by default (see the Lagged regression section).
This is a wrapper of glm. The function does the following steps:
Compute exposure by calling exposure on the LHS (dependent variable).
Modify the formula so that the model is on adoption as a function of exposure and whatever covariates the user specifies.
Selects either "probit" or "logit" and prepares the call to glm. This includes passing the following line:
subset = ifelse(is.na(toa), TRUE, toa \>= per)
This results in including observations that either did not adopted or up to the time of adoption.
Estimates the model.
The data passed to glm is obtained by using as.data.frame.diffnet.
Lagged regression
The model estimated is a lagged regression model that has two main assumptions:
The network is exogenous to the behavior (no selection effect)
The influence effect (diffusion) happens in a lagged fasion, hence, exposure is computed lagged.
If either of these two assumptions is not met, then the model becomes endogenous, ans so inference becomes invalid.
In the case of the first assumption, the user can overcome the non-exogeneity problem by providing an alternative network. This can be done by especifying alt.graph in the exposure function so that the network becomes exogenous to the adoption.