in this video I will demonstrate how to use syntax in SPSS to reproduce your
research for any analytic exercise it is important that one should be able to
reproduce one's research so that there is transparency and in the case where
one makes a mistake in the analysis one can go back identify the mistake correct
it and reproduce the results without having to do the entire analysis again I
will reproduce the results in the Hammermesh study reported in table 1 by
dividing the output for upper division and lower division courses I will be
relying on syntax editor for this task in SPSS one can click on paste rather
than ok by clicking on paste one is able to paste the actual syntax that SPSS
executes to conduct the analysis here is an example of the syntax window where we
start by weighting the data by students and then conduct descriptive analysis to
reproduce results reported in table 1 of the Hammermesh study I computed all
statistics for all observations but while I was doing it I pasted commands
in the syntax window then I would run the select data command and divide the
data into upper and lower division courses and then rerun the same commands
I did in the past for all observations to generate output for upper division
courses and lower division courses this way i don't have to re-click on dialog
boxes to reproduce my results in fact I just select the text once and click on
run and all my output is reproduced even though we are computing averages
standard deviations and counts the task could be a little challenging notice
that the number of faculty members or unique faculty members who taught the
463 courses is 94 and those who taught the lower division courses the unique
number of professors is 42 and for upper division courses it is 79 the way the
data is structured if you were to naively divide the data between lower
and upper division and compute this statistic that is the unique number of
faculty members teaching lower or upper division courses you're likely to get
the wrong answer so let me give you the solution in statistical analysis the
order in which we conduct the analysis matters if we identify unique professors
first and then divide the data later we will get the wrong answer so the correct
approach would be subset the data between upper division and lower
division courses then identify the unique instructors and then compute
statistics that is the number of unique instructors teaching upper and lower
division courses notice that when I select this text and click run selection
SPSS will first turn weight off then immediately turn the weights on by
students and then compute the descriptive statistics for evaluation
and it will compute the two statistics mean and standard deviation and after
that it will turn the weights off to perform the same analysis for lower
division courses I think a copy of the data set using the filter command
re-estimate or compute all the statistics the only thing to remember is
that while I am performing the analysis for lower division courses i will
recompute the variable that identifies each professor uniquely in the data set
for lower division courses and then I will tally the number of unique
instructors who taught the lower division courses notice that I have
highlighted certain commands here and all I have to do is to click on run
selection as soon as I click on the button the output window becomes
activated and you could see the entire output there notice that I returned to
the syntax window and I have highlighted the syntax that created a new variable
called primary last one I will not execute this because the variable
already exists but I need to filter data by this variable so I will click part of
this command and then run this analysis after selecting this text I'll click run
and you can see the output in the output window unique professors or instructors
are 94 to save the data after subsetting it I would click on data select cases
and I would say if condition is satisfied click on if this time I click
on division and division equals upper notice that i
have put upper in quotes it's because the variable is a character variable and in
statistical software when a variable is coded using characters those characters
are specified using the quotation marks I click on continue and then say copy
selected cases to a new data set and I call it upper click OK and now I have
the data set sub set it so that all the observations and the data that is the
courses are upper division courses and now I will recreate the unique
identifier for each professor for upper division course I return to the data set
and compute frequency tabulations I can pick any variable that's a gender and
say ok and there you have it the number of unique instructors who taught upper
division courses is in fact 79