Читать книгу Multilevel Modeling in Plain Language - Karen Robson - Страница 17
Software
ОглавлениеIn the main text of this book we use Stata 13 software. We assume that the reader is familiar with the Stata software program as we do not see this book as an introduction to Stata – see Pevalin and Robson (2009) for such a treatment for an earlier version of Stata. At the time of writing, Stata 13 was the current version, with some changes for the main commands used in this book from version 12 – namely, the change from the xtmixed to the mixed command. While this changed little of the output and only a few options that are now defaults, it did impact on some of the other commands written by others for use after xtmixed. So, at times we use the Stata 12 command xtmixed, which works perfectly well in Stata 13 but is not officially supported. Stata 14 was released while this book was in production and we have checked that the do-files run in version 14.
As you may have gathered from the previous paragraph we use this font for Stata commands in the text. We italicize variable names in the text when we use them on their own, not part of a Stata command, but we also use italics to emphasize some points – we hope that the difference is clear.
In the text we use the /// symbol to break a Stata command over more than one line. For example:
mixed z_read cen_pos || schoolid: cen_pos, ///
stddev covariance(unstructured) nolog
This is only done to keep the commands on the book page. In the do-files (available on the accompanying webpage at the URL given below), the command can run on much further to the right. We have tried to keep what you see on these pages and what you see in the do-file the same, but if you come across a command without the /// in the do-file then don’t worry about it.
At a number of points we include the Stata commands that we used to perform certain tasks, including data manipulation and variable creation. As with all software, there are a number of ways to get what you want, some elegant and some a bit cumbersome. Our rationale is to start by using commands that are easy to follow and then move on to some of the more integrated features in Stata. In doing so, we hope that what we are doing is more transparent. If your programming skills are more advanced than those we demonstrate then we’re sure you’ll be able to think of more elegant ways of coding in no time at all. In the do-files to accompany this book we sometimes include alternate ways of programming to illustrate the versatility of the software.
There is a webpage to accompany this book at https://study.sagepub.com/robson. On this webpage you will find do-files and data files for each of the chapters so you can run through them in Stata and amend them for your own use. You will also find the chapter commands in R, with some explanation how to use R for these multilevel models. The webpage will be very much a ‘live’ document with links to helpful sites and other resources. In the list of references we have noted which papers are ‘open access’. Links to these papers are also on the webpage.
We have chosen to use Stata in this book for two reasons. First, we wanted to use a general-purpose statistical software package rather than a specialized multilevel package. If readers already have experience of Stata then we avoid the challenges of getting to grips with new software. Even so, we could have then chosen from Stata, SPSS, SAS, and R. Which brings us to the second reason: Stata is our preferred software. It’s what we use. It’s what we teach with. And it’s what we have previously written about. We chose to produce matching R code because R is a general-purpose software package and it is freely available. We both have previous experience with SPSS, and so SPSS code for the examples may well materialize on the webpage. For those who can’t wait, Albright and Marinova (2010) have produced a succinct primer for ‘translating’ multilevel models across SPSS, Stata, SAS, and R which is available at: http://www.indiana.edu/~statmath/stat/all/hlm/hlm.pdf
If your preference is for a specialized multilevel package then we strongly recommend that you start with the resources available from the Centre for Multilevel Modelling at the University of Bristol and their MLWiN software (free to academics) at: http://www.bristol.ac.uk/cmm/