Examples / EXAMPLESIX.RPF |
EXAMPLESIX.RPF is a Getting Started example of the use of a RATS format file, and estimation by Non-Linear Least Squares.
Full Program
open data ExampleSix.rat
calendar(q) 1950:1
data(format=rats) 1950:01 2000:04 realcons realdpi
*
* Set up the parameter set and the non-linear formula
*
nonlin a b g
frml cfrml realcons = a+b*realdpi^g
*
* Give guess values to a, b and g using the linear regression when g=1.
*
linreg realcons
# constant realdpi
compute a=%beta(1),b=%beta(2),g=1.0
*
* Estimate the model
*
nlls(frml=cfrml)
Output
Linear Regression - Estimation by Least Squares
Dependent Variable REALCONS
Quarterly Data From 1950:01 To 2000:04
Usable Observations 204
Degrees of Freedom 202
Centered R^2 0.9964481
R-Bar^2 0.9964306
Uncentered R^2 0.9993226
Mean of Dependent Variable 2999.4357843
Std Error of Dependent Variable 1459.7066917
Standard Error of Estimate 87.2098267
Sum of Squared Residuals 1536321.8808
Regression F(1,202) 56669.7234
Significance Level of F 0.0000000
Log Likelihood -1199.9952
Durbin-Watson Statistic 0.0920
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant -80.35474883 14.30585151 -5.61691 0.00000006
2. REALDPI 0.92168567 0.00387175 238.05403 0.00000000
Nonlinear Least Squares - Estimation by Gauss-Newton
Convergence in 65 Iterations. Final criterion was 0.0000003 <= 0.0000100
Dependent Variable REALCONS
Quarterly Data From 1950:01 To 2000:04
Usable Observations 204
Degrees of Freedom 201
Centered R^2 0.9988339
R-Bar^2 0.9988223
Uncentered R^2 0.9997776
Mean of Dependent Variable 2999.4357843
Std Error of Dependent Variable 1459.7066917
Standard Error of Estimate 50.0945979
Sum of Squared Residuals 504403.21571
Regression F(2,201) 86081.2782
Significance Level of F 0.0000000
Log Likelihood -1086.3906
Durbin-Watson Statistic 0.2960
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. A 458.79905447 22.50138682 20.38981 0.00000000
2. B 0.10085209 0.01091037 9.24369 0.00000000
3. G 1.24482749 0.01205479 103.26415 0.00000000
Copyright © 2025 Thomas A. Doan