Type up your answers. Give proper credit to those you work with and/or the text(s).
Solve the following problems. Show all of your work, but keep your answers concise. Highlight your (final) answer to distinguish it from your other numbers and text. Include a copy of your input (e.g. do file) or output (e.g. log file), when it is an appropriate way to show your work. However, do not include unnecessary output (i.e. no data dumps), and format any output so that it is easily readable. An appropriate time to include output is when you put your results in a table--if your results are wrong, then the grader has no idea how you came to your conclusions (i.e. give partial credit) unless you provide some output. Explanation includes statistical and substantive explanation (explain so that a statistical layperson can understand it, and so that a statistical analyst will see your erudition).
mixed y with x w t /print=solution /method=ml /fixed = x w t w*t /random intercept t | subject(id) covtype(un).(Note the period at the end.) On the output, point out where various statistics are reported. Here is one way to do this in SPSS. Open up the data set in SPSS, and use Transform-->Computer Variable... to create the centered time variable. Open a syntax file (like a Stata do-file), and copy in the code and change the variable names. If you want more on the code, you could look here. Model 4 on that page is pretty close to what we are doing. (You can also use the menus to run this model using Analyze-->Mixed Model-->Linear.... I could not figure it out as quickly as the code above.)
proc mixed data=datasetname method=ml noclprint noinfo covtest; class id; model y = x w t w*t /solution notest; random intercept t /type=un sub=id; run;(Notice the "run;" on the end, including the semi-colon.) On the output, point out where various statistics are reported. Here is one way to do this SAS. Go to this page, and use the first example ("random slope model") as a guide. Cut and paste that code into the SAS editor (like a Stata do-file). Then replace the specific variables and data pathways of the example with what you need. The example shows how to bring in a SAS data set (the "data" command; notice that you can use and file pathway on your computer and that you do not need the file suffix if it is a SAS data set); how to create a new variable (the "proc sql" command; the example actually creates two new variables with two sets of commands, but you only need one; notice that it creates and names a new data table); and how to run a multilevel model (the "proc mixed" command, which uses the updated data table).
Back to Assignments page