* FILE = LAB0303.SPS

* NOTE: lines beginning with * are comment lines, not program lines.

* Purpose: this is a syntax file that **you** can run in the comfort

* of your own living room without adult supervision!

* There are several elements of the syntax file

* It will do the following:

******

* go and get the individual level data file

* build an index of attitudes towards gun control.

* A higher score indicates STRONGER belief in more gun control

* To learn more about indexes, you should look up the topic in

* my text RESEARCH METHODS IN CRIMINAL JUSTICE.

* Look under "internal consistency" and/or "Cronbach's alpha"

* I will call this index GUNCNTR

* We will examine the measurement properties of this index. In

* particular we are interested in two things: internal consistency, as

* reflected by Cronbach's alpha, and it's skewness.

*******

* Treating the index as an outcome, we will do some exploratory scattergrams

* or other types of plots, as needed.

* *****

* Then we will run some regressions, simple ones at first, to try and predict

* scores on the index.

*******

* Since we do not have time for lab on 3/4 (my apologies) I want you to try

* and run this on your own. I will be back in town from a conference

* by Sunday around noon. You should CALL ME AT HOME with questions and/or problems that

* you might have if you cannot get this to run, and I will call you back then.

* I also am around next week and the following. Feel free to ring me up.

*******

* What I want you to do is to run all the stuff here, print out all the output,

* and write a paper that interprets the impacts OF JUST THE FIRST TWO SIMPLE

* REGRESSIONS. More specifically, what I want you to do is to interpret:

* b weight

* A (constant)

* R squared

* t test of b weight

* F test of R squared

* Write me a paper talking about all this, and be prepared to hand it in on

* Thursday 3/16.

*

* We are using the individual level data file handed out last week. It was completed

* by about 60 undergraduates. For the purposes of statistical testing you should assume

* that the file represents responses from a random sample of Temple University Criminal

* Justice majors enrolled on main campus for the Spring 1999 semester. That is the population

* to which you want to make statistical inference.

*********

* Note the following:

* 1. If you want to download this file rather than re-type all the instructions

* that you see in this syntax file, you can do so by going to the web-site,

* go to the course syllabus, go to downloads, click on the file of this name,

* and go to "save as" in your browser, and save it.

* SAVE IT AS A PLAIN TEXT FILE. THIS SHOULD BE ASCII

* BUT- if you do do this, and I

* encourage you to do so - life is short, who has time for rekeying - you will

* need to open up the file with an ascii word processor (notepad, edit) DOUBLE CHECK THAT

* the file IS a STRAIGHT ASCII FILE without any html stuff in it. When you look at the

* file you only want to see straight text, like you see on the printed page.

* 2. I have repeated here the instructions for building the index. YOU WILL

* NEED to repeat those instructions in order to build the outcome variable. If you try

* to go right to the regression, it will not work. You need to create the variable first.

* 3. You will need to change in this command file where your version of spss goes to find

* it's data file: what drive, what subdirectory, and so on. Make the change, then resave the

* command file, then highlight the commands to submit them. Notice that when you are

* telling it where to go to find the file, you need to enclose the entire name in

* single quotes (at least for version 6.1)

* 4. At the end of all these comments there is always a command terminator that

* does not look like Arnie [ =7;-( ] rather it looks like this .

* If you fail to end your comments with it the next command will not run.

* 5. ONCE YOU HAVE MADE THE CHANGES YOU NEED IN TERMS OF FILE NAMES, highlight the entire

* syntax file, beginning with the commands below to the end, and run it all at once!

* No more mousing around!

*

***************************

*

This section goes and gets the data file I need. REMEMBER: you will need to change

* where you tell it to look. If you are getting it off of your A drive then your

* FILE= line will look like this:

* FILE='A:\UMET99BB.SAV'.

*

**************************

* COMMANDS START HERE:

* .

GET

FILE='G:\umeth\SURVEY\UMET99BB.SAV'.

EXECUTE .

**************

*

* This section tries to build the GUNCNTRL index of attitudes towards gun control.

* I am not going to build these indexes completely correctly.

* What I should do is to z score each item, and then add them up.

* Before building each index I am going to need to reverse some items

* A higher score indicates beliefs in more gun control, or in the efficacy of those controls

*

*************

* This creates two reversed items so a higher score on them means more faith in gun control

* .

COMPUTE Q45R = (3-Q45) .

EXECUTE .

COMPUTE Q50R = (3-Q50) .

EXECUTE .

* This now looks at the internal consistency of the index. I also have asked for

some descriptive information, so we can see how well the items hang together.

* .

RELIABILITY

/VARIABLES=q38 q39 q41 q45R q47 q50R

/FORMAT=NOLABELS

/SCALE(ALPHA)=ALL/MODEL=ALPHA

/STATISTICS=CORR

/SUMMARY=CORR .

****************************

*

* If you did everything right, you should get a Cronbach's alpha

* of around .77

* That is pretty good!

* Now we will issue the commands to go ahead and make up the index

* itself

* This will be a new variable. We will then look at some of its statistics.

* And of course we will look at the histogram as well.

* We will use the COMPUTE statement. Read up on it in your manuals.

****************************

* .

COMPUTE GUNCNTRL= MEAN.2(q38,q39,q41,q45R,q47,q50R) .

EXECUTE .

FREQUENCIES

VARIABLES=guncntrl /FORMAT=NOTABLE

/STATISTICS=STDDEV VARIANCE MINIMUM MAXIMUM MEAN MEDIAN SKEWNESS SESKW

KURTOSIS SEKURT

/HISTOGRAM NORMAL.

***************************

*

* Look at the histogram, median and mean, look at skewness, and so on, decide if it is

* relatively normal or not.

* I think it passes muster. Do you?

*

* I am now going to leave out of this file a bunch of exploratory stuff that I

* did looking at the correlates of GUNCNTRL. I just ran a bunch of correlations and

* such

* FILE PROCESSING REMINDER: at this point we want to save the file under a new name because

* it has a bunch of new variables. REMEMBER: change the location of the file as needed, just

* like you changed where you got it from.

* The MAP option allows you to see what variables you have in the file now.

*

************************

* .

SAVE OUTFILE='G:\umeth\SURVEY\UMET99cc.SAV' /map

/COMPRESSED.

**********

* These are the exploratory correlations I ran

*

*********

* .

CORRELATIONS

/VARIABLES=guncntrl africam philly q2_3 q10 q13 q14 q15 q16 q17 q29 q31

q62 q63 q64 q65 q66 q73 q74 q75 q77 q78 q79 q80 Q1

/PRINT=TWOTAIL NOSIG

/MISSING=PAIRWISE .

NONPAR CORR

/VARIABLES=guncntrl africam philly q2_3 q10 q13 q14 q15 q16 q17 q29 q31

q62 q63 q64 q65 q66 q73 q74 q75 q77 q78 q79 q80 Q1

/PRINT=KENDALL TWOTAIL NOSIG

/MISSING=PAIRWISE .

**************************

*

* A WHOLE SERIES OF REGRESSIONS

*

* EFFECTS OF AGE ON ATTITUDES TOWARD GUN CONTROL

*

*************************

* .

REGRESSION

/DESCRIPTIVES MEAN STDDEV CORR SIG N

/MISSING MEANSUB

/STATISTICS COEFF OUTS R ANOVA

/CRITERIA=PIN(.05) POUT(.10)

/NOORIGIN

/DEPENDENT guncntrl

/METHOD=ENTER q2_3 .

*****************

* EFFECTS OF GENDER

* THIS IS HARD BECAUSE IT IS A DUMMY VARIABLE

* READ UP IN HAMILTON ON DUMMY VARIABLES

*

****************

* .

REGRESSION

/DESCRIPTIVES MEAN STDDEV CORR SIG N

/MISSING MEANSUB

/STATISTICS COEFF OUTS R ANOVA

/CRITERIA=PIN(.05) POUT(.10)

/NOORIGIN

/DEPENDENT guncntrl

/METHOD=ENTER q1 .

***********************

*

* EFFECTS OF DO GUNS SCARE YOU

*

***********************

* .

 

REGRESSION

/DESCRIPTIVES MEAN STDDEV CORR SIG N

/MISSING MEANSUB

/STATISTICS COEFF OUTS R ANOVA

/CRITERIA=PIN(.05) POUT(.10)

/NOORIGIN

/DEPENDENT guncntrl

/METHOD=ENTER q78 .