Example: confidence

Gretl User's Guide

Gretl User's Guide Gnu Regression, Econometrics and Time-series Library Allin Cottrell Department of Economics Wake Forest University Riccardo Jack Lucchetti Dipartimento di Economia Universit Politecnica delle Marche March, 2018. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version or any later version published by the Free Software Foundation (see ). Contents 1 Introduction 1. Features at a glance .. 1. Acknowledgements .. 1. Installing the programs .. 2. I Running the program 3. 2 Getting started 4. Let's run a regression .. 4. Estimation output .. 6. The main window menus .. 7. Keyboard shortcuts .. 10. The Gretl toolbar .. 10. 3 Modes of working 12. Command scripts .. 12. Saving script objects .. 14. The Gretl console .. 14. The Session concept .. 15. 4 Data files 18.

Gretl User’s Guide Gnu Regression, Econometrics and Time-series Library Allin Cottrell Department of Economics Wake Forest University Riccardo “Jack” Lucchetti

Tags:

  Gretl

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Gretl User's Guide

1 Gretl User's Guide Gnu Regression, Econometrics and Time-series Library Allin Cottrell Department of Economics Wake Forest University Riccardo Jack Lucchetti Dipartimento di Economia Universit Politecnica delle Marche March, 2018. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version or any later version published by the Free Software Foundation (see ). Contents 1 Introduction 1. Features at a glance .. 1. Acknowledgements .. 1. Installing the programs .. 2. I Running the program 3. 2 Getting started 4. Let's run a regression .. 4. Estimation output .. 6. The main window menus .. 7. Keyboard shortcuts .. 10. The Gretl toolbar .. 10. 3 Modes of working 12. Command scripts .. 12. Saving script objects .. 14. The Gretl console .. 14. The Session concept .. 15. 4 Data files 18.

2 Data file formats .. 18. Databases .. 18. Creating a dataset from scratch .. 19. Structuring a dataset .. 21. Panel data specifics .. 23. Missing data values .. 26. Maximum size of data sets .. 27. Data file collections .. 28. Assembling data from multiple sources .. 30. 5 Sub-sampling a dataset 31. Introduction .. 31. Setting the sample .. 31. Restricting the sample .. 32. i Contents ii Panel data .. 33. Resampling and bootstrapping .. 34. 6 Graphs and plots 36. Gnuplot graphs .. 36. Plotting graphs from scripts .. 40. Boxplots .. 42. 7 Joining data sources 44. Introduction .. 44. Basic syntax .. 44. Filtering .. 45. Matching with keys .. 46. Aggregation .. 48. String-valued key variables .. 49. Importing multiple series .. 50. A real-world case .. 51. The representation of dates .. 53. Time-series data .. 54. Special handling of time columns.

3 57. Panel data .. 57. Memo: join options .. 59. 8 Realtime data 62. Introduction .. 62. Atomic format for realtime data .. 62. More on time-related options .. 64. Getting a certain data vintage .. 64. Getting the n-th release for each observation period .. 65. Getting the values at a fixed lag after the observation period .. 66. Getting the revision history for an observation .. 67. 9 Special functions in genr 70. Introduction .. 70. Long-run variance .. 70. Cumulative densities and p-values .. 70. Retrieving internal variables .. 71. The discrete Fourier transform .. 72. 10 Gretl data types 75. Introduction .. 75. Contents iii Series .. 75. Scalars .. 76. Matrices .. 76. Lists .. 76. Strings .. 76. Bundles .. 77. Arrays .. 79. The life cycle of Gretl objects .. 81. 11 Discrete variables 84. Declaring variables as discrete .. 84. Commands for discrete variables.

4 85. 12 Loop constructs 89. Introduction .. 89. Loop control variants .. 89. Progressive mode .. 92. Loop examples .. 92. 13 User-defined functions 96. Defining a function .. 96. Calling a function .. 99. Deleting a function .. 99. Function programming details .. 100. Function packages .. 106. 14 Named lists and strings 107. Named lists .. 107. Named strings .. 112. 15 String-valued series 116. Introduction .. 116. Creating a string-valued series .. 116. Permitted operations .. 118. String-valued series and functions .. 120. Other import formats .. 121. 16 Matrix manipulation 123. Creating matrices .. 123. Empty matrices .. 124. Selecting sub-matrices .. 125. Contents iv Deleting rows or columns .. 126. Matrix operators .. 126. Matrix scalar operators .. 128. Matrix functions .. 128. Matrix accessors .. 135. Namespace issues .. 137. Creating a data series from a matrix.

5 137. Matrices and lists .. 137. Deleting a matrix .. 138. Printing a matrix .. 138. Example: OLS using matrices .. 139. 17 Calendar dates 140. Introduction .. 140. Calendrical functions .. 140. Working with pre-Gregorian dates .. 143. Year numbering .. 144. 18 Cheat sheet 145. Dataset handling .. 145. Creating/modifying variables .. 147. Neat tricks .. 152. II Econometric methods 156. 19 Robust covariance matrix estimation 157. Introduction .. 157. Cross-sectional data and the HCCME .. 158. Time series data and HAC covariance matrices .. 159. Special issues with panel data .. 163. The cluster-robust estimator .. 164. 20 Panel data 166. Estimation of panel models .. 166. Autoregressive panel models .. 172. 21 Dynamic panel models 174. Introduction .. 174. Usage .. 177. Replication of DPD results .. 179. Cross-country growth example .. 182. Contents v Auxiliary test statistics.

6 184. Memo: dpanel options .. 185. 22 Nonlinear least squares 186. Introduction and examples .. 186. Initializing the parameters .. 186. NLS dialog window .. 187. Analytical and numerical derivatives .. 187. Advanced use .. 188. Controlling termination .. 189. Details on the code .. 189. Numerical accuracy .. 189. 23 Maximum likelihood estimation 192. Generic ML estimation with Gretl .. 192. Gamma estimation .. 194. Stochastic frontier cost function .. 195. GARCH models .. 196. Analytical derivatives .. 199. Debugging ML scripts .. 201. Using functions .. 201. Advanced use of mle: functions, analytical derivatives, algorithm choice .. 204. 24 GMM estimation 209. Introduction and terminology .. 209. GMM as Method of Moments .. 210. OLS as GMM .. 213. TSLS as GMM .. 214. Covariance matrix options .. 216. A real example: the Consumption Based Asset Pricing Model.

7 217. Caveats .. 220. 25 Model selection criteria 221. Introduction .. 221. Information criteria .. 221. 26 Degrees of freedom correction 223. Introduction .. 223. Back to basics .. 223. Application to OLS regression .. 224. Beyond OLS .. 224. Contents vi Consistency and awkward cases .. 225. What Gretl does .. 226. 27 Time series filters 229. Fractional differencing .. 229. The Hodrick Prescott filter .. 229. The Baxter and King filter .. 230. The Butterworth filter .. 231. 28 Univariate time series models 233. Introduction .. 233. ARIMA models .. 233. Unit root tests .. 240. Cointegration tests .. 243. ARCH and GARCH .. 243. 29 Vector Autoregressions 247. Notation .. 247. Estimation .. 248. Structural VARs .. 250. Residual-based diagnostic tests .. 253. 30 Cointegration and Vector Error Correction Models 255. Introduction .. 255. Vector Error Correction Models as representation of a cointegrated system.

8 256. Interpretation of the deterministic components .. 257. The Johansen cointegration tests .. 259. Identification of the cointegration vectors .. 260. Over-identifying restrictions .. 262. Numerical solution methods .. 268. 31 Multivariate models 272. The system command .. 272. Restriction and estimation .. 274. System accessors .. 275. 32 Forecasting 277. Introduction .. 277. Saving and inspecting fitted values .. 277. The fcast command .. 277. Univariate forecast evaluation statistics .. 279. Contents vii Forecasts based on VAR models .. 280. Forecasting from simultaneous systems .. 280. 33 State Space Modeling 281. Introduction .. 281. Notation .. 281. Defining the model as a bundle .. 282. Special features of state-space bundles .. 283. The kfilter function .. 284. The ksmooth function .. 284. The kdsmooth function .. 285. The ksimul function.

9 286. Some finer points .. 287. Example scripts .. 289. 34 Numerical methods 298. BFGS .. 298. Newton Raphson .. 300. Simulated Annealing .. 301. Nelder Mead .. 303. Computing a Jacobian .. 303. 35 Discrete and censored dependent variables 308. Logit and probit models .. 308. Ordered response models .. 311. Multinomial logit .. 312. Bivariate probit .. 312. Panel estimators .. 315. The Tobit model .. 316. Interval regression .. 317. Sample selection model .. 319. Count data .. 320. Duration models .. 321. 36 Quantile regression 329. Introduction .. 329. Basic syntax .. 329. Confidence intervals .. 330. Multiple quantiles .. 330. Large datasets .. 331. Contents viii 37 Nonparametric methods 333. Locally weighted regression (loess) .. 333. The Nadaraya Watson estimator .. 335. III Technical details 338. 38 Gretl and TEX 339. Introduction .. 339. TEX-related menu items.

10 339. Fine-tuning typeset output .. 341. Installing and learning TEX .. 344. 39 Gretl and R 345. Introduction .. 345. Starting an interactive R session .. 345. Running an R script .. 348. Taking stuff back and forth .. 349. Interacting with R from the command line .. 352. Performance issues with R .. 354. Further use of the R library .. 354. 40 Gretl and Ox 355. Introduction .. 355. Ox support in Gretl .. 355. Illustration: replication of DPD model .. 357. 41 Gretl and Octave 359. Introduction .. 359. Octave support in Gretl .. 359. Illustration: spectral methods .. 359. 42 Gretl and Stata 363. 43 Gretl and Python 365. Introduction .. 365. Python support in Gretl .. 365. Illustration: linear regression with multicollinearity .. 365. 44 Gretl and Julia 368. Introduction .. 368. Julia support in Gretl .. 368. Illustration .. 368. Contents ix 45 Troubleshooting Gretl 369.


Related search queries