Hello all,
We are looking for a command that (1) can handle a dependent variable whose value is bounded between 0 and 1 and (2) includes firm fixed-effects.
We are using Stata 13 for Windows.
Commands such as “xtivreg2” have the option to include firm fixed-effects. Since our dependent variable is bounded between 0 and 1, however, OLS is inappropriate.
The command “glm” can handle dependent variables whose value is bounded between 0 and 1. We have used “glm” using the following syntax:
glm `dv’ `iv’, link(logit) family(binomial) robust nolog
`dv’ denotes the dependent variable, and `iv’ denotes the independent variables.
We tried manually creating firm fixed-effects by de-meaning each observation, where the mean is based only a firm’s own observations
But this approach does not work with “glm.” For our dependent variable, suppose a firm has two observations, and its values are 0.80 and 0.90, so that its mean is 0.85: The values for the fixed-effects observations would be 0.80 – 0.85 = -0.05 and 0.90 – 0.85 = 0.05, respectively.
“glm” works only if all of the values for the dependent variable lie between 0 and 1. Hence, when we use GLM with our manually created fixed-effects, we get an error message saying that the “dependent variable . . . has negative values.”
In principle, with “glm,” we could include an indicator variable for each firm, but we have ~2,000 firms. Hence, we would rather use another option.
If it matters, some of the observations have a value of 1, but none have a value of 0.
Any help would be very much appreciated.
Best regards,
Jeff
We are looking for a command that (1) can handle a dependent variable whose value is bounded between 0 and 1 and (2) includes firm fixed-effects.
We are using Stata 13 for Windows.
Commands such as “xtivreg2” have the option to include firm fixed-effects. Since our dependent variable is bounded between 0 and 1, however, OLS is inappropriate.
The command “glm” can handle dependent variables whose value is bounded between 0 and 1. We have used “glm” using the following syntax:
glm `dv’ `iv’, link(logit) family(binomial) robust nolog
`dv’ denotes the dependent variable, and `iv’ denotes the independent variables.
We tried manually creating firm fixed-effects by de-meaning each observation, where the mean is based only a firm’s own observations
But this approach does not work with “glm.” For our dependent variable, suppose a firm has two observations, and its values are 0.80 and 0.90, so that its mean is 0.85: The values for the fixed-effects observations would be 0.80 – 0.85 = -0.05 and 0.90 – 0.85 = 0.05, respectively.
“glm” works only if all of the values for the dependent variable lie between 0 and 1. Hence, when we use GLM with our manually created fixed-effects, we get an error message saying that the “dependent variable . . . has negative values.”
In principle, with “glm,” we could include an indicator variable for each firm, but we have ~2,000 firms. Hence, we would rather use another option.
If it matters, some of the observations have a value of 1, but none have a value of 0.
Any help would be very much appreciated.
Best regards,
Jeff
Comment