Statistical Software Scripts

Graphical Software Scripts


Here are some examples of code to show the analysis displayed in the text. The files below are text files although they may have different extensions according to statistical software packages they were written.  Thus, both the R and SAS codes have the extension of ".txt". You may wish to save them with different extensions. Many users of R use the extension ".R" and many users of SAS use the extension ".sas".

 

Mac Users: Please note that the function read.csv(choose.files(), header=TRUE) WILL NOT work on a Macintosh computer. Instead, you will have to enter in the filename manually.

 

Here is an example as to how to read a comma separated data file into "R":

 

healthexp = read.csv("file:///Users/adamfrees/Documents/HealthExpend.csv")

 

Chapter
R
SAS
Excel
Rcmdr
1. Regression and the Normal Distribution
2. Basic Linear Regression
3. Multiple Linear Regression
4. Categorical Explanatory Variables
5. Variable Selection
6. Interpreting Regression Results
7. Modeling Trends
 
8. Autocorrelations and Autoregressive Models
 
9. Forecasting and Time Series Models
 
10. Longitudinal and Panel Data Models
Chap10Rcode For portions of this, you will need the Divorce data file
 
11. Categorical Dependent Variables
 
12. Count Dependent Variables
 
13. Generalized Linear Models
 
14. Mixed Linear Models and Bayesian Regression
 
15. Survival Models
 
16. Two-Part Models
Chap16Rcode For portions of this, you will need the data file here
 
17. Fat-Tail Regression
 
18. Credibility and Bonus-Malus
 
19. Claims Triangles
 
20. Tables and Report Writing
 
21. Graphs
 

 

 

Date: 25 October 2018