Page 5 - Using R for Introductory Econometrics: Read Online
P. 5

1.5.2. Continuous Distributions:

                                                                            Histogram and Density . .   37

                                                                      1.5.3. Empirical Cumulative Dis-

                                                                            tribution Function (ECDF) .  38

                 Contents                                             1.5.4. Fundamental Statistics . . .  40

                                                                 1.6. Probability Distributions . . . . . .  41

                                                                      1.6.1. Discrete Distributions . . .  41

                    Preface . . . . . . . . . . . . . . . . . . .  1  1.6.2. Continuous Distributions .  43

                                                                      1.6.3. Cumulative   Distribution

                 1. Introduction                           3                Function (CDF) . . . . . . .  44

                    1.1. Getting Started . . . . . . . . . . .  3     1.6.4. Random Draws from Prob-

                         1.1.1. Software . . . . . . . . . . .  3           ability Distributions . . . .  45

                         1.1.2. R Scripts . . . . . . . . . . .  4  1.7. Confidence Intervals and Statisti-

                         1.1.3. Packages . . . . . . . . . . .  7     cal Inference . . . . . . . . . . . . .  47

                         1.1.4. File names and the Work-              1.7.1. Confidence Intervals . . . .  47

                               ing Directory . . . . . . . .  8       1.7.2. t Tests . . . . . . . . . . . .  50

                         1.1.5. Errors and Warnings . . . .  9        1.7.3. p Values . . . . . . . . . . .  51

                         1.1.6. Other Resources . . . . . .  9        1.7.4. Automatic calculations . . .  52

                    1.2. Objects in R . . . . . . . . . . . . .  10

                                                                 1.8. Advanced R . . . . . . . . . . . . .  56

                         1.2.1. Basic Calculations and Ob-

                                                                      1.8.1. Conditional Execution . . .  56

                               jects . . . . . . . . . . . . . .  10  1.8.2. Loops . . . . . . . . . . . . .  56

                         1.2.2. Vectors . . . . . . . . . . . .  12   1.8.3. Functions . . . . . . . . . .  57

                         1.2.3. Special Types of Vectors . .  14      1.8.4. Outlook . . . . . . . . . . .  57

                         1.2.4. Naming and Indexing Vectors 15   1.9. Monte Carlo Simulation . . . . . .  58

                         1.2.5. Matrices . . . . . . . . . . .  16    1.9.1. Finite Sample Properties of

                         1.2.6. Lists . . . . . . . . . . . . .  19

                                                                            Estimators . . . . . . . . . .  58

                    1.3. Data Frames and Data Files . . . .  20

                                                                      1.9.2. Asymptotic Properties of

                         1.3.1. Data Frames . . . . . . . . .  20

                                                                            Estimators . . . . . . . . . .  61

                         1.3.2. Subsets of Data . . . . . . .  21     1.9.3. Simulation of Confidence

                         1.3.3. R Data Files . . . . . . . . .  22          Intervals and t Tests . . . .  64

                         1.3.4. Basic Information on a

                               Data Set . . . . . . . . . . .  22

                         1.3.5. Import and Export of Text     I.  Regression Analysis with Cross-

                               Files . . . . . . . . . . . . .  23

                         1.3.6. Import and Export of Other        Sectional Data                       67

                               Data Formats . . . . . . . .  24

                         1.3.7. Data Sets in the Examples .  25  2. The Simple Regression Model         69

                    1.4. Graphics . . . . . . . . . . . . . . .  26  2.1. Simple OLS Regression . . . . . . .  69

                         1.4.1. Basic Graphs . . . . . . . .  26  2.2. Coefficients, Fitted Values, and

                         1.4.2. Customizing Graphs with               Residuals . . . . . . . . . . . . . . .  74

                               Options . . . . . . . . . . .  28  2.3. Goodness of Fit . . . . . . . . . . .  77

                         1.4.3. Overlaying Several Plots . .  29  2.4. Nonlinearities . . . . . . . . . . . .  79

                         1.4.4. Legends . . . . . . . . . . .  30  2.5. Regression through the Origin and

                         1.4.5. Exporting to a File . . . . .  32     Regression on a Constant . . . . .  80

                         1.4.6. Advanced Graphs . . . . .  33    2.6. Expected Values, Variances, and

                    1.5. Descriptive Statistics . . . . . . . .  34   Standard Errors . . . . . . . . . . .  82

                         1.5.1. Discrete Distributions: Fre-     2.7. Monte Carlo Simulations . . . . . .  84

                               quencies and Contingency               2.7.1. One sample . . . . . . . . .  84

                               Tables . . . . . . . . . . . .  34     2.7.2. Many Samples . . . . . . .  86
   1   2   3   4   5   6   7   8   9   10