Use-HLM.pdf

(43 KB) Pobierz
Using the HLM Program
Społeczeństwo - Technologie -
Środowisko
Uniwersytet Jagielloński
Summer, 2015
John B. Nezlek
Department of Psychology
College of William & Mary and
University of Social Sciences and Humanities, Poznan
Overview
• Raw data are used to create a MDM file
• Multilevel Data Matrix
• This is similar to a Save File in SPSS, or a
SAS file in SAS.
• This file is used as the basis for analyses. It
is required.
Overview
• Program joins data from different levels to
create MDM
• Program centers data (no need to center
before creating files)
• No data manipulation in program, no
standardization, and so forth
1
Preparing Data
• Create one data file for each level of
analysis
• For a two level analysis, there are two data
files
• For a three level analysis, there are three
data files
Preparing Data
• Need to be sorted in the same order by an
ID field – often, this is a character (string)
variable – does not have to be.
• Two level file – only one ID field
• Three level file – two ID fields
• Program joins the data files (this is done
manually in some other programs)
Data Transformation
• HLM has NO data transformation
capabilities
• Need to create variables prior to making
MDM file
• HLM does create cross-level interaction
terms, but not within-level interactions
• Typically, new variables are created step by
step as you learn more about your data
2
Missing data in HLM
• Missing data codes need to be created in
raw data sets
• Not allowed at level 2 in a two level file
• Not allowed at level 2 or level 3 in a three
level file
• Allowed at level 1
Evaluating missing data
• How many data are missing?
• Why are they missing?
• Is the fact that certain data are missing
important?
• If it is important, should it be modeled or
analyzed?
• In many applications it is not important, but
it can be very important
Systematically missing data
• If some data are missing systematically, this
may mean something
• The fact that some type of data are
systematically missing at level 1 can be
modeled at level 2
• Are relationships involving other variables
the same for cases with and without missing
values?
3
Missing data at levels 2 and 3
• Cases with any missing data on variables
included in the MDM file at these levels
will be excluded from the MDM file
• Possible solution, create MDM files that do
not include the variables that have missing
values
Missing data at level 2
• Why are data missing?
• What is the pattern?
• If there are a few cases that have lots of
missing data, excluding the cases is
probably best
• If there are only a few data that are missing
sporadically and not systematically, some
sort of substitution may be appropriate
Missing data at level 1
• Missing data codes need to be created in raw data
set
• When constructing MDM, you need to indicate if
there are any missing data
• If there are missing data there are 2 options
• Delete when creating MDM – only complete cases
are included in MDM
• Delete when running analysis – cases are included
in a specific analysis if there are no missing data
for the variables included in the analysis
4
Which method?
• Why are data missing? What is the pattern?
• If there are only a few data that are missing
sporadically and not systematically, when
“running analyses” is probably best
• If there are a few cases that have lots of
missing data, when “creating MDM” is
probably best
How the Program Works
• Create save file (MDM)
• Interface is used to create command file based on
MDM file
• Commands indicate dependent measure,
predictors at each level, error terms, centering, and
all aspects of the analysis
• Output file is a separate text file – can/should be
named
• Command file can be saved for future use – also a
text file
Making the MDM file
•
•
•
•
Select “make new MDM file”
Specify ASCII or Stat Package input
Stat package much, much easier
Specify type of MDM file (invariably
hierarchical linear models)
5
Zgłoś jeśli naruszono regulamin