CPANEL Procedure

Example 11.4 Crime Rates in North Carolina: Instrumental Variables Regression

Cornwell and Trumbull (1994) examined data on crime rates from 90 counties in North Carolina and collected data each year from 1981 to 1987. The following statements create the Crime data table. These statements assume that your libref is named mylib, but you can substitute any appropriately defined libref.

data mylib.Crime;
   input county year west central urban d82 d83 d84 d85 d86 d87
         lcrmrte lprbarr lprbconv lprbpris lavgsen lpolpc
         ldensity ltaxpc lwcon lwtuc lwtrd lwfir lwser lwmfg
         lwfed lwsta lwloc lmix lpctymle lpctmin;
   label county    = 'county identifier'
         year      = '81 to 87'
         west      = '1 if in western N.C.'
         central   = '1 if in central N.C.'
         urban     = '1 if in SMSA'

   ... more lines ...   

The variables are too numerous to describe individually, but they are fully labeled in the regression output and are summarized as follows:

  • The panel ID variables are County and Year.

  • The dependent variable, LCrmRte, is the log of the crime rate (number of crimes divided by total population).

  • The variables West, Central, and Urban provide geographical background for each county.

  • The variables D82 through D87 are dummy variables for year effects.

  • The variables with the LPrb prefix are log-probabilities of police or legal actions. For example, LPrbArr is the log-probability of an arrest given that a crime was committed.

  • The variables with the LW prefix are log weekly wages for various occupations and industries.

  • Other variables that begin with the letter L are log-transformed. For example, the variable LPolPC is the log of police per capita.

Cornwell and Trumbull (1994) fit a fixed-effects model for the log of crime rate, with the log-probability of arrest (LPrbArr), and the log of police per capita (LPolPC) among the regressors. They noted that these two regressors were endogenous because of the following causality loops:

  • Although police presence might decrease the crime rate because of deterrence (or increase the crime rate because of better reporting), an increase in crime might cause a desire for more police presence.

  • Although the crime rate might fall if more crimes resulted in arrest, a rising crime rate could cause the probability of arrest to decrease because police resources would be spread thin.

To deal with the endogeneity, Cornwell and Trumbull (1994) fit a two-stage least squares (2SLS) model with county-level fixed effects, with two external instruments: LTaxPC (log tax revenue per capita) and LMix (log ratio of crimes that involve face-to-face contact). Their rationale for using these instruments is that counties with higher tax revenues have more police presence and that face-to-face crimes have a higher probability of arrest because victims could identify their offenders.

Baltagi (2006) proposed a similar 2SLS model, but with random effects instead of fixed effects for counties. The following statements recreate that estimation:

proc cpanel data =  mylib.crime;
   id county year;
   model lcrmrte = lprbarr lpolpc lprbconv lprbpris lavgsen ldensity
                   lwcon lwtuc lwtrd lwfir lwser lwmfg lwfed lwsta
                   lwloc lpctymle lpctmin west central urban
                   d82 d83 d84 d85 d86 d87 / ivranone;
   endogenous lprbarr lpolpc;
   instruments ltaxpc lmix;
run;

The results are shown in Figure 5. The output includes a "Structural Summary" table, which lists the endogenous variables and the instrumental variables. The list of instrumental variables includes both the specified external instruments (variables LTaxPC and LMix) and the exogenous regression variables.

Figure 5: Crime Rates in North Carolina, IV Random Effects

The CPANEL Procedure
EC2SLS One-Way Random Effects (IVRanOne)
Dependent Variable: lcrmrte (log crimes committed per person)

Model Description
Estimation MethodIVRanOne
Variance EstimationModel Based
Data SetCRIME
Number of Observations630
Number of Cross Sections90
Time Series Length7

Fit Statistics
SSE12.1250DFE603
MSE0.0201Root MSE0.1418

Variance Component Estimates
SourceVarianceStandard
Deviation
Cross Sections0.0460360.21456
Error0.0222720.149239

Hausman Test For Random Effects
CoefficientsDFm ValuePr > m
222219.500.6140

Structural Summary
Endogenous Variableslprbarr lpolpc
Instrumentslprbconv lprbpris lavgsen ldensity lwcon lwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc lpctymle lpctmin west central urban d82 d83 d84 d85 d86 d87 ltaxpc lmix

Parameter Estimates
VariableTypeDFEstimateStandard
Error
t ValuePr > |t|Label
Intercept 1-0.95381.2840-0.740.4579Intercept
lprbarrEN1-0.412930.0974-4.24<.0001log probability of arrest
lpolpcEN10.4347490.08974.85<.0001log police per capita
lprbconv 1-0.322890.0536-6.03<.0001log probability of conviction
lprbpris 1-0.186320.0419-4.44<.0001log probability of prison sentence
lavgsen 1-0.010180.0270-0.380.7066log avg. sentence in days
ldensity 10.4290280.05487.82<.0001log people per sq. mile
lwcon 1-0.007480.0396-0.190.8503log weekly wage, construction
lwtuc 10.0454450.01982.300.0220log wkly wge, trns, util, commun
lwtrd 1-0.008140.0414-0.200.8441log wkly wge, whlesle, retail trade
lwfir 1-0.003640.0289-0.130.8999log wkly wge, fin, ins, real est
lwser 10.005610.02010.280.7805log wkly wge, service industry
lwmfg 1-0.204140.0804-2.540.0114log wkly wge, manufacturing
lwfed 1-0.163510.1594-1.030.3056log wkly wge, fed employees
lwsta 1-0.054050.1057-0.510.6092log wkly wge, state employees
lwloc 10.1630520.11961.360.1734log wkly wge, local gov emps
lpctymle 1-0.108110.1397-0.770.4393log percent young male
lpctmin 10.1890370.04154.56<.0001log perc. minority, 1980
west 1-0.226840.0996-2.280.02311 if in western N.C.
central 1-0.194040.0598-3.240.00121 if in central N.C.
urban 1-0.225150.1156-1.950.05201 if in SMSA
d82 10.0107450.02580.420.67721 if year == 82
d83 1-0.083790.0307-2.730.00651 if year == 83
d84 1-0.10350.0371-2.790.00541 if year == 84
d85 1-0.09570.0495-1.940.05341 if year == 85
d86 1-0.06890.0596-1.160.24811 if year == 86
d87 1-0.031410.0705-0.450.65621 if year == 87

EN: endogenous variable


Cornwell and Trumbull (1994) favored a fixed-effects approach because a Hausman specification test rejected the null hypothesis of random effects. Baltagi (2006) argued that the Hausman test used by Cornwell and Trumbull (1994) was inaccurate because it was based on standard methodology that did not account for endogeneity in the regressors.

Baltagi (2006) proposed a modified 2SLS Hausman test, and the results of that test are provided in the "Hausman Test For Random Effects" table in the output. The results favor the random-effects specification.

A higher probability of arrest is shown to diminish crime, and police presence increases the crime rate because more crimes are reported.

The following statements fit the model by two-step GMM with robust standard errors:

proc cpanel data =  mylib.crime;
   id county year;
   model lcrmrte = lprbarr lpolpc lprbconv lprbpris lavgsen ldensity
                   lwcon lwtuc lwtrd lwfir lwser lwmfg lwfed lwsta
                   lwloc lpctymle lpctmin west central urban
                   d82 d83 d84 d85 d86 d87 / ivranone gmm = twostep
                   robust;
   endogenous lprbarr lpolpc;
   instruments ltaxpc lmix;
run;

The results are shown in Output 11.4.1. The coefficients do not change much, but the standard errors are now more reliable. You can also obtain bias-corrected standard errors by using the BIASCORRECTED option according to the method of Windmeijer (2005).

Output 11.4.1: Crime Rates in North Carolina, IV Random Effects by Two-Step GMM

The CPANEL Procedure
EC2SLS One-Way Random Effects (IVRanOne)
Dependent Variable: lcrmrte (log crimes committed per person)

Model Description
Estimation MethodIVRanOne
Estimation TechniqueTwo-Step GMM
Variance EstimationRobust
Data SetCRIME
Number of Observations630
Number of Cross Sections90
Time Series Length7

Fit Statistics
SSE12.3814DFE603
MSE0.0205Root MSE0.1433

Variance Component Estimates
SourceVarianceStandard
Deviation
Cross Sections0.0460360.21456
Error0.0222720.149239

Hausman Test For Random Effects
CoefficientsDFm ValuePr > m
222215.770.8271

Structural Summary
Endogenous Variableslprbarr lpolpc
Instrumentslprbconv lprbpris lavgsen ldensity lwcon lwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc lpctymle lpctmin west central urban d82 d83 d84 d85 d86 d87 ltaxpc lmix

Parameter Estimates
VariableTypeDFEstimateStandard
Error
t ValuePr > |t|Label
Intercept 1-1.667971.1204-1.490.1371Intercept
lprbarrEN1-0.378580.1137-3.330.0009log probability of arrest
lpolpcEN10.4265730.08584.97<.0001log police per capita
lprbconv 1-0.312450.0587-5.32<.0001log probability of conviction
lprbpris 1-0.148170.0458-3.230.0013log probability of prison sentence
lavgsen 10.0303590.03090.980.3255log avg. sentence in days
ldensity 10.3406290.05855.83<.0001log people per sq. mile
lwcon 1-0.027370.0246-1.110.2658log weekly wage, construction
lwtuc 10.0299040.01951.540.1248log wkly wge, trns, util, commun
lwtrd 10.0039370.04220.090.9258log wkly wge, whlesle, retail trade
lwfir 1-0.002480.0131-0.190.8498log wkly wge, fin, ins, real est
lwser 1-0.004340.0130-0.330.7379log wkly wge, service industry
lwmfg 1-0.161740.0835-1.940.0532log wkly wge, manufacturing
lwfed 1-0.007090.1499-0.050.9623log wkly wge, fed employees
lwsta 1-0.025070.0798-0.310.7535log wkly wge, state employees
lwloc 10.0900920.10890.830.4086log wkly wge, local gov emps
lpctymle 1-0.077070.1143-0.670.5002log percent young male
lpctmin 10.1815260.04783.790.0002log perc. minority, 1980
west 1-0.21510.1031-2.090.03741 if in western N.C.
central 1-0.167080.0537-3.110.00201 if in central N.C.
urban 1-0.129480.0816-1.590.11291 if in SMSA
d82 10.016540.02420.680.49391 if year == 82
d83 1-0.070280.0313-2.250.02511 if year == 83
d84 1-0.097660.0339-2.880.00411 if year == 84
d85 1-0.087870.0462-1.900.05781 if year == 85
d86 1-0.05860.0508-1.150.24921 if year == 86
d87 1-0.020470.0580-0.350.72441 if year == 87

EN: endogenous variable


Last updated: July 09, 2026