Explore computer applications in econometrics with Excel, EViews and SAS, worked examples, regression, ANOVA and time-series tests.

Computer Applications in Econometrics: A Practical Guide

Computer Applications in Econometrics: A Practical Guide

ECONOMETRICS • COMPUTATION • REPRODUCIBLE ANALYSIS

Computer applications in econometrics turn raw observations into statistical evidence. However, useful evidence requires more than a regression button: analysts must import data correctly, choose a defensible model, check assumptions, and explain uncertainty.

This guide connects those tasks through Excel, EViews, and SAS. Along the way, you will reproduce descriptive statistics, compare means, estimate regressions, investigate serial correlation, and interpret unit root and Granger causality tests.

What makes this guide different? You get transparent numerical checks, a comparison of mean ratios versus ratios of totals, a multicollinearity audit, and a lag-by-lag degrees-of-freedom budget. These additions show how apparently minor software choices can change an economic conclusion.

Scope and provenance: The supplied chapter photographs, pages 266–282, provide the teaching examples and historical output discussed here. Explanations are original, and calculations use the visible observations wherever complete data appear. Historical ADF and Granger results are interpreted from the supplied output rather than presented as newly estimated results. The examples illustrate methods; they are not current agricultural or commercial estimates.

What do computer applications in econometrics actually do?

Econometrics combines economic questions, mathematical models, and observed data. Computers make the repetitive calculations feasible, while software helps analysts inspect results and compare specifications. Nevertheless, the researcher still owns the decisions that make an estimate meaningful.

Consider a production question: does fertilizer use predict corn output? A spreadsheet can calculate the relationship in seconds. Yet the result alone cannot separate fertilizer effects from weather, technological change, land quality, or farmers’ expectations.

Therefore, begin with the question rather than the software menu. Decide whether you need a description, a forecast, a hypothesis test, or a causal estimate. Each goal changes the necessary data and the interpretation of the output.

Six connected stages of a defensible analysis
TaskComputer contributionResearcher responsibility
ImportReads rows, columns, dates, and valuesVerify types, units, identifiers, and missing codes
DescribeCalculates summaries and draws chartsChoose meaningful groups and scales
EstimateFits coefficients and residualsSpecify the model and justify the sample
TestCalculates statistics and probabilitiesCheck assumptions and state the null
ForecastProjects outcomes from a fitted modelPrevent future information from entering training
CommunicateExports tables and figuresExplain uncertainty and avoid causal overclaims

Choose software around the analysis

Excel makes small datasets and cell-level calculations easy to inspect. EViews organizes dated economic series and offers specialized time-series tools. Meanwhile, SAS supports explicit data-processing programs and repeatable statistical procedures.

For a teaching project, one tool may cover the entire workflow. In a larger study, you might inspect a file in Excel and estimate the final model through a saved program. Above all, use the same observations and specification when comparing outputs.

Practical roles rather than a universal software ranking
FeatureExcelEViewsSAS
Small-data inspectionWorksheet and formulasSeries and group viewsPRINT and data exploration procedures
OLS regressionAnalysis ToolPak; LINESTEquation estimationPROC REG
Time-series diagnosticsUsually require additional workDedicated series and equation viewsSAS/ETS procedures such as AUTOREG
RepeatabilitySaved formulas and documented stepsSaved workfiles and programsSaved DATA and PROC steps
Main beginner riskRanges and references driftDates or lag specifications differImport assumptions or missing-value rules differ

Reference: Microsoft: Analysis ToolPak capabilities.

Data formats: the first econometric decision

A statistical model cannot rescue a wrongly imported dataset. For example, a program may read a decimal comma as a column separator, treat an identification code as a number, or confuse a missing observation with zero. Consequently, data import deserves the same care as model estimation.

Delimited files versus fixed-width files

A delimited file separates fields with characters such as commas, tabs, or semicolons. By contrast, a fixed-width file assigns each variable to specified character positions. Neither format guarantees that the program will infer the correct meaning.

Common ways to store two variables
FormatIllustrationImportant check
Comma-delimited1,6Specify delimiter, quotation rules, and decimal convention
Tab-delimitedTwo values separated by a tabDistinguish tabs from repeated spaces
Semicolon-delimited1;6Commonly accompanies decimal-comma exports
Fixed-widthID in characters 1–4; value in 6–12Read the codebook before assigning positions

Suppose a location is “New York.” A naive whitespace split creates two fields from one name. However, a correctly quoted CSV record keeps the location together:

location,population_millions
"New York",18.2
"North Carolina",7.7

These numbers reproduce a historical format example; they do not represent current populations. Similarly, an ID such as 0017 should remain text if the leading zeros carry meaning. A numeric conversion would silently change its representation.

Build a small data dictionary

Before estimating anything, describe each variable’s name, unit, frequency, source, and missing-value convention. Then document the observational unit: one student, one store, one country-year, or one calendar month. Otherwise, rows that look comparable may describe different things.

A minimal dictionary for the production example
VariableMeaningUnit or typeValidation
yearObservation yearAnnual integerUnique and ordered in this dataset
cornOutput measure in the teaching exampleOriginal example unitsPositive values; verify original unit definition
fertilizerFertilizer inputOriginal example unitsNonnegative values
insecticideSecond production inputOriginal example unitsNonnegative values
ratiofertilizer divided by cornInput units per output unitUndefined if corn is zero

Run five import checks

  1. Compare the imported row count with the source.
  2. Inspect the first and last observations.
  3. Check minimums, maximums, and missing counts.
  4. Confirm unique keys and correctly ordered dates.
  5. Recalculate at least one value manually.

For instance, the first production ratio below must equal 6/40 = 0.15. If your software gives 6.40, 15, or a missing value, investigate the import or formula before continuing. A one-minute check can prevent a fully formatted but incorrect report.

Descriptive statistics: verify the small example first

The score example contains ten observations: 6, 7, 6, 8, 5, 7, 6, 9, 10, 6. Because the dataset is short, you can check every result directly. This makes it a useful benchmark for validating software settings.

Mean, median, mode, and dispersion

x̄ = (Σxi)/n    •    s² = Σ(xi − x̄)²/(n − 1)    •    s = √s²
Recalculated score statistics; format the last result as a percentage
StatisticResultExcel formula with scores in B2:B11
Count10=COUNT(B2:B11)
Mean7.000000=AVERAGE(B2:B11)
Median6.5=MEDIAN(B2:B11)
Mode6=MODE.SNGL(B2:B11)
Sample variance2.444444=VAR.S(B2:B11)
Sample standard deviation1.563472=STDEV.S(B2:B11)
Population variance2.2=VAR.P(B2:B11)
Coefficient of variation22.3353%=STDEV.S(B2:B11)/AVERAGE(B2:B11)

The squared deviations sum to 22. Therefore, the sample variance equals 22/9, while the population variance equals 22/10. Those different denominators explain a common disagreement between programs.

The mean exceeds the median because the high scores pull the average upward. Meanwhile, the mode identifies 6 as the most frequent observation. None of these measures substitutes for inspecting the full distribution.

A frequency chart with explicit categories

For these integer scores, one category per score avoids arbitrary bin boundaries. An ordinary histogram for a continuous variable instead requires a defensible set of intervals. Consequently, charts from two programs may look different even when both imported identical data.

Exact score frequencies and cumulative distribution
ScoreFrequencyCumulative share
5110%
6450%
7270%
8180%
9190%
101100%
Frequency of scores: score 6 occurs four times, score 7 twice, and each other score once012345678910ScoreFrequency
Figure 1. Original chart calculated from the ten supplied scores.

Standardize scores without moving the reference cells

zi = (xi − x̄)/s

A score of 6 has z ≈ −0.6396; a score of 10 has z ≈ 1.9188. Thus, the highest observation sits about 1.92 sample standard deviations above the mean. Standardization changes the scale, but it does not turn the distribution into a normal distribution.

=(B2-AVERAGE($B$2:$B$11))/STDEV.S($B$2:$B$11)

Copy this formula down the rows. The relative reference B2 changes, whereas the dollar signs keep the summary range fixed. As a final check, the standardized observations should have a mean close to zero and a sample standard deviation close to one.

Use the coefficient of variation carefully

The coefficient of variation divides the standard deviation by the mean. However, a meaningful interpretation generally requires a meaningful zero and a mean away from zero. For test scores, report the numerical value cautiously: changing the scoring origin can alter the ratio without changing relative performance.

Comparing means with t-tests and ANOVA

The packaging example asks whether sales differ across three alternatives. Each group contains five observations. First, inspect the raw values rather than jumping straight to a p-value.

Sales values transcribed from the supplied example
ObservationPackaging 1Packaging 2Packaging 3
1877890
2838191
3797984
4818282
5808088
Mean828087
Sample variance102.515

Example 1: does Packaging 1 have a mean of 85?

State the hypotheses before calculating: H₀: μ = 85 and H₁: μ ≠ 85. Because the population standard deviation is unknown, use a one-sample t statistic. Under independent normal observations, the reference distribution has n − 1 degrees of freedom.

t = (x̄ − μ0)/(s/√n) = (82 − 85)/(√10/√5) = −2.1213

Here, df = 4 and the two-sided p-value is approximately 0.10119. Therefore, the sample does not reject a mean of 85 at the 5% level. It also falls just outside a 10% rejection rule.

However, this finding does not establish that the true mean equals 85. The 95% confidence interval is approximately 78.07 to 85.93, which shows the uncertainty directly. A small sample can leave a practically relevant difference unresolved.

=(AVERAGE(A2:A6)-85)/(STDEV.S(A2:A6)/SQRT(COUNT(A2:A6)))
=T.DIST.2T(ABS(t_statistic_cell),COUNT(A2:A6)-1)

Example 2: do Packaging 1 and Packaging 2 have equal means?

The historical exercise specifies a pooled, equal-variance comparison. Accordingly, its pooled variance is 6.25, its t statistic is 1.26491, and its degrees of freedom equal 8. The resulting two-sided p-value is approximately 0.24150.

sp² = [(n1 − 1)s1² + (n2 − 1)s2²]/(n1 + n2 − 2)

Therefore, the pooled test does not reject equality at 5%. Nevertheless, the observed variances differ, and the dataset contains little information about population variances. In a new analysis without a justified equal-variance assumption, consider Welch’s comparison.

=T.TEST(A2:A6,B2:B6,2,2)   /* two-sided pooled test */
=T.TEST(A2:A6,B2:B6,2,3)   /* two-sided Welch test */

The comments explain the formulas; do not paste the comments into worksheet cells. These ranges apply to the packaging sheet only.

Also determine whether the observations are independent or paired. Measurements from the same stores under two designs may call for a paired analysis. In contrast, separate randomly assigned stores support an independent-samples comparison.

Reference: Microsoft: T.TEST arguments and test types.

Example 3: compare all three packaging means

A one-way ANOVA tests H₀: μ₁ = μ₂ = μ₃. Its alternative states that at least one population mean differs. Consequently, rejection does not imply that every pair differs.

Recalculated ANOVA decomposition
Variation sourceSum of squaresdfMean squareF
Between groups1302657.09091
Within groups110129.16667—
Total24014——
F = MSbetween/MSwithin = 65/9.16667 = 7.09091

The p-value is approximately 0.00927, so the test rejects equal means at 5%. Moreover, the sample effect-size ratio η² = 130/240 ≈ 0.5417 indicates that group membership accounts for about 54.17% of the total sum of squares in these observations.

That percentage describes this sample, not a proven causal contribution from packaging. Random assignment, independence, and the absence of competing differences matter for a causal interpretation. For specific pairwise conclusions, use planned contrasts or a suitable multiple-comparison procedure.

The classical ANOVA model assumes independent errors, a common error variance, and normally distributed errors for exact small-sample inference. With only five observations per group, neither a normality test nor a tidy chart can establish those assumptions. Therefore, inspect the study design as well as the output.

Reference: NIST: one-way ANOVA model and assumptions.

Regression: from a fitted line to an economic interpretation

The production example provides ten annual observations from 1971 through 1980. Use the full table below to reproduce the calculations. Although the labels describe agricultural inputs and output, the supplied pages do not establish all physical unit definitions, so interpret slopes in the original example units.

Complete teaching dataset; ratios are newly calculated
YearCorn output YFertilizer X₁Insecticide X₂X₁/Y
197140640.150000
1972441040.227273
1973461250.260870
1974481470.291667
1975521690.307692
19765818120.310345
19776022140.366667
19786824200.352941
19797426210.351351
19808032240.400000

Example 4: covariance and correlation

Fertilizer and corn move together strongly in this sample. The sample covariance equals 106.2222, while the Pearson correlation is approximately 0.985418. However, covariance changes with measurement units, whereas correlation removes those units.

rXY = Σ(Xi − X̄)(Yi − Ȳ) / √[Σ(Xi − X̄)² Σ(Yi − Ȳ)²]

In a production sheet with year in A, corn in B, fertilizer in C, and insecticide in D, use =CORREL(B2:B11,C2:C11). For sample covariance, use =COVARIANCE.S(B2:B11,C2:C11). Keep both ranges aligned by year.

Because both variables rise over time, the correlation alone provides weak evidence about a production mechanism. For example, a common technology trend could lift output while farmers also increase inputs. A scatterplot helps describe the pattern but cannot remove that ambiguity.

Example 5: estimate simple ordinary least squares

Yt = β0 + β1X1t + ut
Ŷt = 27.1250 + 1.659722X1t

Ordinary least squares chooses coefficients that minimize the sum of squared residuals. Here, the fitted slope associates one additional fertilizer unit with approximately 1.6597 additional output units. Importantly, “associates” does not mean that a controlled intervention would produce the same change.

The model has R² ≈ 0.971049 and a residual sum of squares of 47.30556. With an intercept and one regressor, it uses two coefficients and leaves eight residual degrees of freedom. The fitted intercept describes an extrapolation to zero fertilizer, which lies outside the observed range of 6 to 32.

R² = 1 − SSE/SST = 1 − 47.30556/1634 ≈ 0.971049
Corn output versus fertilizer with the fitted ordinary least squares line304050607080905101520253035Corn outputFertilizer input
Figure 2. Original scatterplot and OLS line from the displayed data. The line summarizes association within the observed range.

Example 6: add a second input

Next, include insecticide alongside fertilizer. The multiple regression estimates a partial association for each input while holding the other included input constant. It does not hold every unobserved production condition constant.

Ŷt = 31.980671 + 0.650051X1t + 1.109868X2t
Same observations, different conditioning information
MeasureSimple regressionMultiple regression
Observations1010
Estimated coefficients, including intercept23
Residual degrees of freedom87
Fertilizer slope1.6597220.650051
Insecticide slopeNot included1.109868
R²0.9710490.991634
Residual sum of squares47.30555613.670397
Residual standard error2.4317061.397467

The fertilizer coefficient falls from about 1.66 to 0.65 after adding insecticide. Thus, the simple-regression coefficient partly reflects variation that fertilizer shares with the second input. This comparison illustrates specification sensitivity, although it does not establish that the multiple model has eliminated omitted-variable bias.

At fertilizer = 18 and insecticide = 12, the multiple model predicts 57. Actual output is 58, so the residual equals +1. That concrete check verifies the coefficient order and the residual sign.

A hidden issue: excellent fit can coexist with multicollinearity

The two inputs also move together strongly. Regressing either input on the other and an intercept gives a variance inflation factor of approximately 18.46. Therefore, the dataset contains limited independent movement for separating their partial associations.

VIFj = 1/(1 − Rj²)

A large VIF does not automatically bias OLS coefficients. Instead, it signals that collinearity inflates coefficient variance relative to a comparable design with independent predictors. In this ten-row example, avoid interpreting a precise-looking decimal as evidence of a stable economic parameter.

Also remember that adding a regressor cannot increase the minimized in-sample SSE when the sample stays fixed. As a result, a higher unadjusted R² is not a sufficient model-selection rule. Examine theory, diagnostics, adjusted fit, and performance on genuinely unseen observations.

Read residuals before trusting the regression table

Multiple-regression residual audit
YearActual outputFitted outputResidual
19714040.320448-0.320448
19724442.920651+1.079349
19734645.330621+0.669379
19744848.850458-0.850458
19755252.370295-0.370295
19765857.000000+1.000000
19776061.819939-1.819939
19786869.779247-1.779247
19797472.189217+1.810783
19808079.419125+0.580875

With an intercept, OLS residuals sum to approximately zero, apart from floating-point rounding. However, that algebraic property does not establish a well-specified model. Inspect residuals against fitted values, time, and each explanatory variable.

Curvature may indicate a missing nonlinear relationship. Meanwhile, a widening spread may suggest heteroskedasticity, and runs of positive or negative residuals may suggest serial dependence. A residual chart directs attention; a formal test and economic reasoning help evaluate the suspected problem.

Ratios reveal a subtle weighting problem

The fertilizer-to-output ratio equals fertilizer divided by corn. It measures input intensity in input units per output unit. Unless numerator and denominator share compatible units, calling it a percentage or a “proportion” would mislead the reader.

rt = X1t/Yt

In the first year, the ratio equals 0.15; in the last year, it equals 0.40. Across all ten years, the arithmetic mean of the annual ratios is approximately 0.301881. However, dividing total fertilizer by total corn gives 180/570 ≈ 0.315789.

Two correct calculations with different interpretations
CalculationValueQuestion answered
Mean of yearly ratios0.301881What is the average annual intensity, with equal weight per year?
Ratio of totals0.315789How much fertilizer accompanies one output unit across the combined observations?
Difference0.013909How much does output weighting change the summary?
ΣX1t/ΣYt = Σ[wtrt],   wt = Yt/ΣYt

The ratio of totals weights each annual ratio by that year’s output. Consequently, higher-output years matter more. In this dataset, those years also tend to have higher input intensity, so the weighted result exceeds the simple average.

This distinction also appears in finance, labor economics, and business dashboards. For example, an average of branch profit margins generally differs from the company margin calculated from total profit and total revenue. Neither summary is universally correct; the intended question determines the weighting.

Guard against denominator problems

A zero denominator makes the ratio undefined. Moreover, a very small denominator can create an extreme value even when the numerator changes little. Therefore, flag denominator issues explicitly rather than converting every error to zero.

=IF(B2=0,NA(),C2/B2)

For datasets with missing values, add a separate missing-data check before division. Otherwise, spreadsheet arithmetic may treat an empty cell differently from a statistical package. Record whether the ratio describes individual observations or aggregated totals.

Serial correlation: test the residuals, not just the series

A time series can display persistence without invalidating every regression that uses it. The relevant regression question concerns the disturbance process after conditioning on the model. Accordingly, distinguish a series correlogram from a residual correlogram.

What the Durbin–Watson statistic measures

DW = Σt=2…T(et − et−1)² / Σt=1…Tet²

The simple production regression gives DW ≈ 1.7836, and the multiple regression gives DW ≈ 2.1141. In contrast, regressing the input-intensity ratio on an intercept alone gives DW ≈ 0.2842. The third result reflects pronounced persistence in deviations from the ratio’s sample mean.

Values near two often suggest little first-order residual correlation. Nevertheless, that rule of thumb is not a hypothesis test. Formal interpretation depends on the model, regressors, sample size, and relevant critical values.

Why “DW near two” is not a clean bill of health

A model can have higher-order dependence even when its first-order diagnostic looks unremarkable. Moreover, the conventional Durbin–Watson testing framework does not apply straightforwardly when lagged dependent variables enter the regression. Therefore, use diagnostics that match the specification.

EViews provides residual correlograms and serial-correlation LM testing. In its equation window, the documented residual-diagnostics menu includes the LM test and a choice of test order. Save that order alongside the reported result so another analyst can reproduce the check.

Reference: EViews: residual diagnostics.

Choose a repair that matches the problem

Different problems require different repairs
Possible problemPotential responseWhat the response does not guarantee
Omitted seasonal or dynamic structureAdd theoretically justified termsCausal identification
Autoregressive disturbancesEstimate a regression with AR errorsCorrect mean specification
Valid coefficient model but dependent errorsConsider HAC standard errorsRemoval of coefficient bias or nonstationarity
Unit roots or cointegrationChoose a suitable time-series specificationValidity of arbitrary differencing
Structural changeInvestigate break dates and stabilityReliable inference from very short samples
Yt = β0 + β′Xt + ut
ut = ρut−1 + εt

An AR-error model describes persistence in the disturbance. By contrast, adding a lagged dependent variable changes the conditional mean equation. Those choices can lead to different economic interpretations, so avoid treating them as interchangeable buttons.

SAS documents autoregressive-error estimation through PROC AUTOREG. Its documentation also explains that sign conventions for reported AR parameters require care. Consequently, compare the actual model equations before comparing an EViews coefficient with a SAS coefficient.

Reference: SAS: regression with autocorrelated errors and parameter signs.

Unit root testing: specify the question before the test

Many economic series trend or remain highly persistent. A standard levels regression can then produce impressive fit without a meaningful stable relationship. Before applying conventional time-series inference, investigate the process that generates the observations.

The augmented Dickey–Fuller equation

ΔYt = α + δt + γYt−1 + Σj=1…pφjΔYt−j + εt

The ADF null hypothesis is γ = 0, which represents a unit root in this specification. A sufficiently negative statistic provides evidence against that null. However, ordinary Student’s t critical values do not apply to the unit-root statistic.

Choose whether to include an intercept, a trend, or neither. Then choose the number of lagged differences and the sample. These decisions affect both the reference distribution and the test’s ability to detect departures from the null.

EViews allows analysts to select the series transformation, deterministic terms, and lag settings. Its documentation also warns that an ordinary unit-root test on estimated regression residuals needs different critical values for cointegration testing. Therefore, use the appropriate cointegration routine rather than reusing a standalone ADF threshold.

Reference: EViews: unit root testing and specification choices.

What the historical ADF output supports

The supplied chapter first reports a levels test that does not reject a unit root. It then reports a first-difference test statistic around −2.711. In that second output, the statistic crosses the displayed 10% threshold but not the 5% threshold.

Thus, the result offers weaker evidence against a unit root in the differenced series than a conventional 5% rejection would provide. Avoid saying that the test “accepts” a unit root or definitively proves an integration order. Failure to reject may reflect limited power, especially with a small sample.

The underlying series for this historical ADF exercise is not fully supplied in the photographs. Accordingly, these statements interpret the displayed output rather than claim an independent replication. A reproducible new study must retain the full series and exact test settings.

Differencing is a modeling choice, not a cleanup command

First differences describe period-to-period changes. Log differences approximately describe proportional changes when the changes are small. As a result, differencing changes the economic question as well as the statistical properties.

Furthermore, cointegrated nonstationary variables may contain a meaningful long-run relationship. An error-correction model can combine that relationship with short-run movements. Automatically differencing everything can discard information that the research question needs.

Granger causality: predictive information and a lag budget

A Granger causality test asks whether past values of one variable improve prediction of another after accounting for specified information already in the model. It addresses predictive content. A successful test alone does not establish a causal effect from an intervention.

The restricted and unrestricted comparison

Yt = a + Σj=1…pbjYt−j + Σj=1…pcjXt−j + ut
H0: c1 = c2 = … = cp = 0

The unrestricted equation includes both sets of lags. By contrast, the restricted equation omits the lagged X terms. Therefore, the test compares the improvement in fit with the number of restrictions and the remaining residual degrees of freedom.

F = [(SSER − SSEU)/p] / [SSEU/(neff − kU)]

In a two-variable model with an intercept and p lags of each variable, kᵤ = 1 + 2p. With T consecutive complete observations and no additional sample loss, nₑff = T − p. Consequently, the residual degrees of freedom equal T − 3p − 1.

Why six lags can be expensive

The supplied example begins with 35 annual observations and uses six lags. Accordingly, the reported estimation sample contains 29 observations. Each unrestricted equation includes 13 coefficients, leaving just 16 residual degrees of freedom.

Lag budget for 35 complete observations; intercept included, no extra regressors
Lags pEffective observationsCoefficients per equationResidual df
134331
233528
431922
6291316
8271710
1025214

At ten lags, only four residual degrees of freedom remain. Therefore, a seemingly modest lag change can greatly reduce precision. More data history does not automatically justify more parameters when the effective sample is short.

Read both directions separately

Historical output in the supplied photograph; six lags and 29 usable observations
Null hypothesisReported FReported p-valueDecision at 5%
X does not Granger-cause Y2.596010.05957Do not reject
Y does not Granger-cause X0.535530.77363Do not reject

At 5%, neither direction rejects its null. Under a preselected 10% rule, the X-to-Y direction would reject, while the reverse direction would not. However, choosing a significance threshold after seeing the p-value weakens the interpretation.

The first p-value also does not mean there is a 5.957% probability that the null is true. It describes the extremeness of the test statistic under the null and the test assumptions. Report the numerical result and uncertainty rather than forcing a dramatic yes-or-no causal narrative.

EViews documents the command cause(6) x y for a six-lag pairwise test. The standard pairwise specification includes an intercept and lags of the two variables; it does not automatically control for every other series in a workfile. Additional conditioning variables require a suitable broader model.

Reference: EViews: pairwise Granger causality command and regressors.

Check the time-series framework first

Ordinary finite-order Granger testing requires a suitable stationary framework for its conventional reference distribution. If the variables are integrated or cointegrated, choose an appropriate formulation, such as a justified error-correction approach or a carefully implemented augmented-VAR method. Simply copying the lag count from an old example does not establish validity.

Also consider omitted common drivers, release timing, and residual dependence. A variable published later may appear to predict another only because the dataset assigns both values to the same reference period. For operational forecasting, align observations by when the information became available.

Computer applications in econometrics across three tools

The following workflows use the same production table. Their purpose is to preserve the model across interfaces. Nevertheless, menu names and installation details can differ by version, so consult the linked vendor documentation for your environment.

Excel: make the worksheet auditable

  1. Create a production sheet with headers: year, corn, fertilizer, insecticide.
  2. Place the ten observations in rows 2 through 11.
  3. Keep an untouched copy of the source values.
  4. Activate the Analysis ToolPak if the Data Analysis command is unavailable.
  5. Choose Regression, using corn as Y and both inputs as X.
  6. Match the Labels option to whether your ranges include headers.
  7. Request residuals and save the output beside the sample definition.

Alternatively, the formula below requests coefficients and additional regression statistics. For the stated column arrangement, the first returned row orders the slopes as insecticide, fertilizer, and then intercept. Thus, labeling coefficients without checking array order can reverse the economic interpretation.

=LINEST(B2:B11,C2:D11,TRUE,TRUE)

Keep the intercept unless theory justifies a zero-intercept model. Moreover, do not mix a chart’s rounded trendline equation with full-precision coefficients for subsequent calculations. Use the underlying regression output when calculating predictions and residuals.

Reference: Microsoft: LINEST syntax, returned coefficient order, and statistics.

EViews: define the dates and save the equation

Create an annual workfile covering 1971–1980, then import the production table with the correct variable names. Verify the year alignment before estimating. Afterward, retain the equation object and the sample selection.

' After importing and checking the annual series:
smpl 1971 1980
series ratio = fertilizer/corn
equation eq_simple.ls corn c fertilizer
equation eq_multiple.ls corn c fertilizer insecticide

' A different disturbance specification, for investigation:
equation eq_ar1.ls corn c fertilizer insecticide ar(1)

The AR(1) line illustrates a different specification; it is not an instruction to add AR errors automatically. In particular, inspect residual diagnostics and the available sample before choosing that model. Small datasets offer limited room for additional parameters.

For ADF testing, record the transformation, deterministic terms, and lag-selection method. Likewise, for Granger testing, record both directions, the lag count, and the effective sample. Those settings matter more for reproducibility than a screenshot of the toolbar.

SAS: import explicitly and inspect the log

The following program embeds the ten observations so that no external path is necessary. In practice, replace the inline data with an explicitly configured import from your source file. Then inspect the log for conversion problems, missing values, and unexpected row counts.

data production;
  infile datalines dsd truncover;
  input year corn fertilizer insecticide;
  if corn > 0 then ratio = fertilizer/corn;
  else ratio = .;
datalines;
1971,40,6,4
1972,44,10,4
1973,46,12,5
1974,48,14,7
1975,52,16,9
1976,58,18,12
1977,60,22,14
1978,68,24,20
1979,74,26,21
1980,80,32,24
;
run;

proc print data=production;
run;

proc means data=production n nmiss mean std min max;
  var corn fertilizer insecticide ratio;
run;

proc corr data=production;
  var corn fertilizer insecticide;
run;

proc reg data=production;
  model corn = fertilizer insecticide / vif;
  output out=regcheck p=fitted r=residual;
run;
quit;

The DSD option handles comma-delimited input and consecutive delimiters as missing fields. Meanwhile, PROC REG estimates the linear model and writes fitted values and residuals to a separate dataset. These saved objects make later checks easier to reproduce.

Reference: SAS DATA step statements: INFILE and DSD.

Reference: SAS: PROC REG reference.

For an exploratory AR(1)-error specification in an installation with SAS/ETS, the corresponding procedure is:

proc autoreg data=production;
  model corn = fertilizer insecticide / nlag=1 method=ml;
run;

However, matching an AR-error order across programs does not ensure identical likelihood conventions or treatment of initial observations. Record the estimation method and compare the retained sample. The code examples are templates; the numerical benchmarks in this article come from independent calculations, not claimed live runs of Excel, EViews, or SAS.

Reference: SAS: autoregressive error model estimation methods.

Reproducibility: explain why two programs disagree

When coefficients differ across programs, investigate the inputs before questioning the numerical algorithm. Often, the packages estimated different models or used different observations. A systematic comparison usually reveals the source of the discrepancy.

A cross-software reconciliation checklist
CheckHow a mismatch changes results
Observation countMissing values or lags alter the estimation sample
Dates and sort orderMisalignment changes pairings and time-series calculations
InterceptDropping it changes coefficients and fit measures
Units and transformationsPercent versus proportion or level versus log changes scale
Variance estimatorClassical, robust, and HAC errors produce different inference
Test directionOne-sided and two-sided p-values answer different questions
Degrees of freedomSample and population formulas use different denominators
PrecisionRounded coefficients generate different fitted values
Optimization and initializationDynamic models can use different estimation conventions

Use numerical invariants as quick error detectors

Several identities provide inexpensive checks. For example, an intercept-only OLS estimate must equal the sample mean. In a simple OLS regression with an intercept and the same complete observations, R² must equal the squared Pearson correlation.

Likewise, the ANOVA sums of squares must reconcile: 130 + 110 = 240. For the multiple production regression, fitted values plus residuals must recover actual output. Therefore, these checks can expose a range mismatch without requiring a second software package.

Do not let revised economic data leak into historical forecasts

Real economic databases can revise previously published observations. As a result, today’s value for a past period may differ from the value an analyst knew at that time. A historical forecast experiment should respect that information boundary.

The Federal Reserve Bank of St. Louis explains that FRED displays updated vintages while ALFRED preserves earlier releases. Accordingly, use vintage information when your question concerns real-time decisions. Saving only a download date may be insufficient for reconstructing the information set available at an earlier forecast origin.

Reference: Federal Reserve Bank of St. Louis: Data Revisions with FRED.

Save a compact analysis record

Keep the raw file, data dictionary, cleaning rules, software version, model formula, and sample definition together. Then retain the output and enough code or formulas to rebuild it. Finally, record which values came from original data, which came from transformations, and which results you transcribed from a historical source.

For a time-series model, add the observation frequency, date range, lag structure, deterministic terms, and covariance estimator. Additionally, for a hypothesis test, state the null, alternative, significance level, and assumptions. Clear reporting often prevents more confusion than another page of coefficients.

Twelve checkpoints connecting the chapter topics

A practical review map rather than a transcription of the textbook
CheckpointYour verification target
1. Explain the computer’s roleSeparate calculation from model justification
2. Distinguish data formatsIdentify delimiters or fixed character positions
3. Import text safelyPreserve spaces in names and inspect missing values
4. Describe and standardizeMean 7; sample SD 1.563472
5. Compare packaging meansOne-sample p 0.10119; ANOVA p 0.00927
6. Fit a simple production modelSlope 1.659722; R² 0.971049
7. Add the second inputFertilizer slope 0.650051; R² 0.991634
8. Move data between toolsRetain ten correctly dated observations
9. Calculate input intensityMean ratio 0.301881
10. Investigate serial dependenceRatio-on-constant DW 0.2842
11. Read an ADF resultIdentify null, deterministic terms, lags, and threshold
12. Interpret Granger output29 usable observations; 16 residual df per unrestricted equation

Frequently asked questions

Can Excel handle econometric analysis?

Excel can support descriptive statistics, mean comparisons, and standard linear regression. However, more specialized time-series work requires additional implementation or suitable software. Choose the tool according to the model, then verify the actual capabilities of your installed version.

Which is better for beginners: Excel, EViews, or SAS?

The best starting point depends on your learning goal. Excel makes individual calculations visible, while EViews provides an organized environment for dated series. Meanwhile, SAS encourages explicit data-processing and estimation programs.

Does an R² above 0.99 mean the model is correct?

No. A high R² describes in-sample fit under a particular specification. For example, common trends, omitted variables, or overfitting can produce excellent fit without reliable causal interpretation or forecasting performance.

Should I always correct autocorrelation by adding AR(1)?

No. First investigate whether the problem reflects omitted dynamics, a trend, seasonality, nonstationarity, or the disturbance process. Then choose a response that matches the economic and statistical problem.

Does Granger causality establish real-world causation?

No. It tests incremental predictive information within a specified information set and lag structure. A causal claim additionally requires assumptions or a research design that addresses confounding and the meaning of an intervention.

Why do my results differ slightly from the printed example?

Small differences may come from rounding, sample selection, or software conventions. Larger differences often indicate a data entry error, a misplaced variable, or a changed specification. Compare the raw observations and model settings before interpreting the discrepancy.

How many observations do I need?

No single minimum works for every model. The answer depends on parameter count, signal strength, dependence, and the inferential goal. As the lag-budget table shows, 35 observations can leave only four residual degrees of freedom in a ten-lag bivariate equation.

Conclusion: make every result traceable

Computer applications in econometrics work best when every result connects to a clear question, a documented dataset, and a defensible model. Start with import checks, verify simple calculations, and only then move to regression and time-series inference. This sequence makes errors easier to find and conclusions easier to defend.

The examples also show why careful interpretation matters. A mean ratio differs from a ratio of totals, a higher R² can hide collinearity, and additional lags can consume most of a small sample. Therefore, the strongest analysis combines reliable computation with transparent reasoning about what the data can support.

Calculation note. Numerical benchmarks use the observations printed in this article and independent Python/NumPy/SciPy calculations. Values may differ in their final displayed digit because of rounding. Historical ADF and Granger output remains explicitly labeled; no missing source observations have been invented.

Further reading. Continue with regression diagnostics, time-series methods, and Granger causality exercises.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *