AMS 315
Data Analysis
First Computing Assignment
The first report is due on Tuesday, March 26, but can be submitted without penalty by April 2. This report is worth 60 examination points. Please remember that there is a second project coming, so that you should finish the first project as soon as possible. Please submit your project via e-mail as instructed on the Class Blackboard. Detailed submission information is online.
Project 1 has two parts. There are three files for this project. Two of the files are for part A, and one file is for part B. The files are labeled with the last four digits of your Stony Brook ID number.
Part A
Part A is worth 20 points. The two files for part A each contain a column for subject ID and a column for either the dependent variable value or the independent variable value. Your first task is to sort the two files by subject ID and merge them. You should not just use “cut and paste” to merge your data. Second, you are expected to deal with missing data. Your report should contain the count of the number of subject IDs that had at least one independent variable value or dependent variable value. It should also include the count of the number of subject IDs that had an independent variable value, the count of the number of subject IDs that had a dependent variable value, the count of the number of subject IDs that had both an independent and dependent variable value, and the count of the number of subject IDs that had at least one independent variable value or dependent variable value.
Your second task is to impute the missing values. There are a number of missing data procedures. Often a statistical package has imputation algorithms in the software. For example, R has 5 different algorithms available. You may choose any algorithm except for listwise deletion. Specify your choice in your report. Often, the choice of imputation method has little effect on the results if the fraction of missing data is 30% or less. Then, you should use the statistical package of your choice to find the fitted linear model.
Part B
Part B is worth 40 points. The data file for part B contains one line for each subject ID. The line will contain the subject ID, the value of the independent variable, and the value of the dependent variable. A transformation of either IV or DV or both may be required. You should read the text for suggestions on fitting a model. A lack of fit (LOF) test should be applied. It is your responsibility to find repeated (or near repeated) independent variable values. That is, you should bin near repeated data into one level. For example, suppose that and . While there are not exactly repeated x values, you could bin these points into one group of nearly repeated points. That is, choose the average x-value as the value of x after binning. Then your binned data would be and . Now perform a LOF test on the data set after binning all near repeated values.
You must submit a one-page report on Problem A and a one-page report on Problem B. Each report should have four sections. The introduction should contain a statement of the problem and the objective of the paper. This part is easy: your problem is to recover the function that was used to generate the dependent variable value based on the value of the independent variable. The data you receive will be generated by a simulation program. The second section should describe your methodology. Specifically, how the files were merged, the program used to perform the statistical analysis, whether you used linear regression and additional procedures such as a lack of fit test, how much missing data was present in the data, and the procedure for dealing with missing data. The third section should contain your results: what fraction of the variation of the dependent variable was explained, the analysis of variance table, the fitted function, confidence intervals for slope and test of the null hypothesis that the slope was zero. The fourth section should be conclusions and discussion. This section should focus on “big picture” issues. Was there an association between the variables? How important was it? That is, what was the r-squared value. What is your fitted function? You may submit a longer appendix of computer work and programs.
Important note:
Simply submitting your computer output is not acceptable and will receive a grade of 0. You must submit a formal report to begin to get non-zero credit.
Grading Comments from last semester
Make sure that you focus on “big picture” issues in your reports. For example, what is the function that you chose to fit the data. Have you accounted for all of the observations that you were given? Do your results make sense? Make sure that you edit your findings to focus on your final model. A useful example of reporting other models in part B is reporting the r-squared for a model with no transformations to establish a base of comparison. Avoid putting large amounts of code in your report. These can be placed in an appendix. Even here, editing the code that your report to the actual code that you used to get your final report is valuable.