get data /type = xlsx /file = "d:\data\Survey Monkey 2013\Sheet_1_export_2.xlsx" /sheet = name "Sheet_1_export_2" /cellrange = full /readnames = on. * deleting variables that will not be needed. delete variables collectorid startdate enddate ipaddress emailaddress firstname lastname customdata. * removing first case (b/c it has variable names in it). select if ~missing(respondentid). exe. * renaming the first four variables. rename variables whatisyourgender = gender. rename variables (WhatyearofschoolareyouinEnteranumber Whatisyourmajor DidyouattendanothercollegeuniversitybeforecomingtoUCLA = yearschool major other_univ). * renaming q5. rename variables (howdoyoustudy to v26 = q5notes q5recording q5internet q5assigned q5suggested q5problems q5homework q5tutor q5sessions q5friend q5group q5previous q5other). * renaming q6. rename variables Onaveragehowmanyhoursdoyoustudyforeachclassyoutake = hrs_study. * renaming q7. rename variables (Pleasetelluswhereyouprefertostudyandwhereyouactuallydostudy.Choo V29 V30 V31 V32 V33 V34 V35 = q7home q7library q7park q7donutshop q7otherhome q7commonroom q7coffee q7other). * renaming q8. rename variables (WhatkindofnoiseleveldoyoupreferwhenstudyingPleaserankyouranswers V37 V38 V39 V40 = q8silence q8little q8moderate q8lots q8nomatter). * renaming q9 and q10. rename variables (Atwhattimeofthedaydoyoudoyourmosteffectivestudyingchooseallthata V42 V43 V44 V45 Ifyoucouldchangeonethingtomakeyourstudyingmoreeffectivewhatwould = q9any_s q9morning_s q9afternoon_s q9evening_s q9night_s onechange). * note that all of the variables are string, even though they have numeric values. * this means that you have to convert all of the strings to numerics. * there are a few ways to do that. * recoding variables. * recoding the string variable gender into the numeric variable female. * note that you had to know that males are coded as 2; there is nothing in the data file that tells you that. alter type gender (f2.0). recode gender (2 = 0)(else = copy) into female. variable labels female "gender of respondent". value labels female 0 "male" 1 "female". crosstabs /tables gender by female. * changing yearschool and other_univ to be numeric with two digits and no decimals. alter type yearschool other_univ (f2.0). *recoding other_univ 1 = yes and 2 = no. * notice that we did not create a new numeric variable when we did this. recode other_univ (2 = 0) (else = copy). value labels other_univ 0 "no" 1 "yes". * recoding q5 from string to numeric. alter type q5notes to q5previous (f2.0). variable labels q5notes "Read/rewrite notes from class". variable labels q5recording "Listen to a recording of the lecture". variable labels q5internet "Find more information on the internet". variable labels q5assigned "Read text assigned in class". variable labels q5suggested "Read text suggested in class". variable labels q5problems "Work practice problems". variable labels q5homework "Do assigned homework". variable labels q5tutor "Hire a tutor". variable labels q5sessions "Attend study sessions lead by the TA". variable labels q5friend "Study with a friend or classmate". variable labels q5group "Study in a group". variable labels q5previous "Get tips from someone who took the class in a previous quarter". variable labels q5other "Other (please specify)". value labels q5notes to q5previous 1 "never" 2 "rarely" 3 "often" 4 "always". * recoding hrs_study from string to numeric. alter type hrs_study (f2.0). variable labels hrs_study "On average how many hours do you study for each class you take?". value labels hrs_study 1 "0-5" 2 "6-10" 3 "11-15" 4 "16-20" 5 "more than 20". exe. * recoding q7 from string to numeric. alter type q7home to q7coffee (f2.0). variable labels q7home "Please tell us where you prefer to study and where you actually study: home". variable labels q7library "Please tell us where you prefer to study and where you actually study: library". variable labels q7park "Please tell us where you prefer to study and where you actually study: park". variable labels q7donutshop "Please tell us where you prefer to study and where you actually study: donutshop". variable labels q7otherhome "Please tell us where you prefer to study and where you actually study: someone else's home". variable labels q7commonroom "Please tell us where you prefer to study and where you actually study: a common room". variable labels q7coffee "Please tell us where you prefer to study and where you actually study: coffee shop". variable labels q7other "Please tell us where you prefer to study and where you actually study: other". value labels q7home to q7coffee 1 "Prefer to study here:" 2 "Usually study here:". exe. * recoding q8 from string to numeric. alter type q8silence to q8nomatter (f2.0). variable labels q8silence "Absolute silence". variable labels q8little "A little background noise (such as soft music)". variable labels q8moderate "A moderate amount of background noise (such as a TV)". variable labels q8lots "A lot of background noise (such as a party or concert)". variable labels q8nomatter "The amount of background noise does not matter to me". value labels q8silence to q8nomatter 1 "Strongly like" 2 "Like" 3 "Dislike" 4 "Strongly dislike". * recoding q9 from string to numeric. * Notice that no respondent selected "afternoon". compute q9any = 0. if q9any_s = "1" q9any = 1. compute q9morning = 0. if q9morning_s = "2" q9morning = 1. compute q9afternoon = 0. if q9afternoon_s = "3" q9afternoon = 1. compute q9evening = 0. if q9evening_s = "4" q9evening = 1. compute q9night = 0. if q9night_s = "5" q9night = 1. exe. variable labels q9any "At what time of the day do you do your most effectives tudying: any time that I have time". variable labels q9morning "At what time of the day do you do your most effectives tudying: morning". variable labels q9afternoon "At what time of the day do you do your most effectives tudying: afternoon". variable labels q9evening "At what time of the day do you do your most effectives tudying: evening". variable labels q9night "At what time of the day do you do your most effectives tudying: night". value labels q9any to q9night 0 "No" 1 "Yes". crosstabs /tables q9any_s by q9any /tables q9morning_s by q9morning /tables q9afternoon_s by q9afternoon /tables q9evening_s by q9evening /tables q9night_s by q9night. * making q9 a single variable is a problem b/c respondents could (and did) choose more than one option. * you can reduce it to a single variable based on substantive considerations or on number of options selected. compute q9total = sum(q9any to q9night). variable labels q9total "Total number of options selected". freq var = q9total. * the delete variables command does not take a wild card. delete variables gender q9morning_s to q9night_s. document These data were collected via Survey Monkey at www.surveymonkey.com/s/z3bxppp. Questions 2 and 9 are problematic. Some response options from question 5 and question 7 should be replaced. These data were extracted using the numerical values option. variable width all (8). variable width major q5other q7other onechange (15). save outfile "D:\data\survey monkey 2013\numerical_values_cleaned.sav" /keep = RespondentID female yearschool major other_univ q5notes q5recording q5internet q5assigned q5suggested q5problems q5homework q5tutor q5sessions q5friend q5group q5previous q5other hrs_study q7home q7library q7park q7donutshop q7otherhome q7commonroom q7coffee q8silence q8little q8moderate q8lots q8nomatter q9any q9morning q9afternoon q9evening q9night q9total onechange. * data analysis. * hypothesis 1: Do study habits differ between males and females?. sort cases by female. split file by female. * getting descriptive statistics. freq var = q9total. means hrs_study. * can include other analysis commands here. split file off. unianova hrs_study by female /print = descriptive. crosstabs /tables female by q5notes q5recording q5internet q5assigned q5suggested q5problems q5homework q5tutor q5sessions q5friend q5group q5previous. * hypothesis 2: Do study habits change over time?. crosstabs /tables yearschool by q5notes q5recording q5internet q5assigned q5suggested q5problems q5homework q5tutor q5sessions q5friend q5group q5previous. crosstabs /tables yearschool by hrs_study. correlations yearschool hrs_study. graph /scatterplot(bivar) yearschool with hrs_study. crosstabs /tables yearschool by q7home q7library q7park q7donutshop q7otherhome q7commonroom q7coffee. crosstabs /tables yearschool by q8silence q8little q8moderate q8lots q8nomatter. crosstabs /tables yearschool by q9any q9morning q9afternoon q9evening q9night. * hypothsis 3: Do study habits vary by major?. crosstabs /tables major by q5notes q5recording q5internet q5assigned q5suggested q5problems q5homework q5tutor q5sessions q5friend q5group q5previous. crosstabs /tables major by hrs_study. crosstabs /tables major by q7home q7library q7park q7donutshop q7otherhome q7commonroom q7coffee. crosstabs /tables major by q8silence q8little q8moderate q8lots q8nomatter. crosstabs /tables major by q9any q9morning q9afternoon q9evening q9night.