SPSS 1 intro LEM TRN 002 Wed PDF

Title SPSS 1 intro LEM TRN 002 Wed
Author Sin YI Tsang
Course IC Training couse
Institution 香港理工大學
Pages 43
File Size 1.4 MB
File Type PDF
Total Downloads 56
Total Views 147

Summary

lecture notes...


Description

SPSS1Introduction

1/18/2021

1

LearningOutcomes • Bytheendofthismodule,youshouldbeable to: 1. Formulateengineeringandbusinessproblemsinstatistical modelforcomputer‐aidedanalysis 2. Applycomputer‐aidedstatisticalanalysistodiscoverhidden patternsandtrendsinsurveydatasets 3. Validatestatisticalhypothesisonexperimentdatausing computer‐aidedanalysis 4. Composeanalysisresultbasedontheoutputsofcomputer‐ aidedanalysis 1/18/2021

2

Inthissection • Structureofthiscourse • StatisticAnalysis • SPSSInterface • VariableSettingsandLevelofMeasurement • DataTransformation • CheckDataErrorBeforeDataAnalysis 1/18/2021

3

ClassSchedule Section (3hours each)

Topic

1

IntroductionofSPSS

GradedAssignment/*Non‐gradedAssignment Date 27‐Jan‐21

2

1. *Datafiledesign 2. *Datafrauddetection Descriptivestatistics, 1. *SummaryTable,ClusterBarChart,ClusterLineChart 2. *OLAPCube,Percentiles,BoxPlot graphical 3. *Histogram,NormalDistribution presentation

3‐Feb‐21

3

T‐Test

1.T‐testonstudents’gradesinquizzesandfinalexam

10‐Feb‐21

4

Correlation

1. *Multiplecorrelationstudyonhelpingbehaviour

24‐Feb‐21

5

Linearregression

1. Multipleregressionstudyonhelpingbehaviour

3‐Mar‐21

6

Analysisofvariance (ANOVA)

1. Relationshipbetweenyearsofeducation,gender,andemployment 10‐Mar‐21 2. Relationshipbetweenworkinghours,gender,andhighestdegree

7

Factorandreliability analysis

1. Factoranalysisonquestionnaire 2. Reliabilityanalysisonquestionnaire

8

Tutorial/Report writing Tutorial/Report writing Multiplechoicetest (1‐hour)

9 10

1/18/2021

17‐Mar‐21 24‐Mar‐21 31‐Mar‐21

1. Test 2. Report

7‐Apr‐21 4

Structureofthiscourse • Task – Classworkforappreciationandpractice – Notmarked,butneedyourparticipation

• GradedAssignment – – – – –

Assignmentforin‐classpracticeandevaluation Markedforfinalgrade Youshoulddoitin‐class Everysection(section3,5,6,7)carryequalweighting 50%ofthetotalmarkofthemodule

1/18/2021

5

Structureofthiscourse • Non‐GradedAssignment – – – –

Assignmentforin‐classpractice NotMarked Youshoulddoitin‐class Everysection(section1,2,4)

1/18/2021

6

Structureofthiscourse • Assignmentsubmission – Namethefilenameas [StudentID]_[SectionNo.] eg.forassignmentreportofstudent12345678d,insection 2:12345678d_2.doc – StoreyouassignmentinD:\student\[Student_ID]\ – Alwaysleaveabackupinyoure‐mailbox,USBdrive,etc – Donotputtheassignmentonthedesktopandshutdown themachine.Thedatawillbeerasedafterrebooting. – Submitbytheendoftheclass,unlessotherwisearranged. – Latesubmissionorsubmissionwithoutattendancewillnot bemarked. – CopyingcasewillbesenttoAcademicRegistrydirectly. 7 1/18/2021

Structureofthiscourse • Test – – – –

10multiple‐choicequestions 1‐hourduration Open‐booktest 30%ofthetotalmarkofthemodule

• Report – Reportonthemethods,findingsandevaluation – Submitrightaftercompletionofmodule – 20%ofthetotalmarkofthemodule

1/18/2021

8

Inthissection • Structureofthiscourse • StatisticAnalysis • SPSSInterface • VariableSettingsandLevelofMeasurement • DataTransformation • CheckDataErrorBeforeDataAnalysis 1/18/2021

9

StatisticAnalysis • StatisticAnalysisPurpose – Simplifyinformationandfilternoise – Findpatternandrelationships – Findmeaningindata

• StatisticAnalysisApplication – – – –

Measurethecauseandeffect Makepredictions Makedecisions Datamining

1/18/2021

10

Statisticalanalysissoftware • Dostatisticsanalysiswithoutbeingamathematician • SPSSmeans: – Importing/enteringdata – Processingofdata – Comparisonofdata – Computationofstatisticalresults – Presentationofstatisticalresults • SPSSdoesnot: – Automaticallygiveananswerfromapoolofdata 1/18/2021

11

Inthissection • Structureofthiscourse • StatisticAnalysis • SPSSInterface • VariableSettingsandLevelofMeasurement • DataTransformation • CheckDataErrorBeforeDataAnalysis 1/18/2021

12

SPSSInterface 1. Dataeditor – Dataview – Variableview

2. Outputviewer

Data editor

Output viewer

– Generatereport

3. Syntaxeditor – Automatetaskswith commandlanguage – File>New>Syntax Syntax editor 1/18/2021

13

SPSSHelp • Generalhelp – Help>Topics

• Dialogbox – Rightclickavariable>variableinformation

• Pivottable – Rightclickroworcolumnheader>What’sthis?

1/18/2021

14

OpenaDataFile • Openadatafile – File>Open>Data • Select “grades.sav”andclickopen

– DraganddropthedatafileintotheSPSSsoftware

• Fileformatsyoucanopen – *.sav (PASWstatisticaldatafile) – *.xlsx /*.xls (Spreadsheetfiles) – *.txt(delimited/fixed‐widthdatafile) 1/18/2021

15

DataView • Dataviewisadatatable – EachrowisaCase: • Theobjectyouwanttoinvestigate

– EachcolumnisaVariable • E.g.name,date,age… • UseVariableViewtosetthedetailofvariable

– EachcellisaValue: • Contentofavariableofacase

– AssigneachcasewithauniqueID Variable

Case

Value 1/18/2021

16

VariableView • Click VariableViewatthebottomoftheData View • Eachrowisavariableanditsproperties – E.g.variablename,type,width,decimal,label,value label,missing,measure,… Setting of variable

Variable

1/18/2021

Variable View

17

Inthissection • Structureofthiscourse • StatisticAnalysis • SPSSInterface • VariableSettingsandLevelofMeasurement • DataTransformation • CheckDataErrorBeforeDataAnalysis 1/18/2021

18

VariableProperties • Valuelabels – Addmeaningtovalues – e.g.1:“male”,2:“female”

• Missingvalues – Assignvaluefor“novalue” – e.g.‐1forage

• Measure ofavariable: – 3LevelsofMeasurement

Levelofmeasurement • Measurementcanbeclassifiedinto3levels: – Nominal: • categoricaldata,e.g.1:blue,2:red,3:green • norankingbetweendata

– Ordinal: • orderedcategoricaldata,e.g.1:bad,2:OK,3:good • usuallynotscalable:e.g.OKisnottwiceofbad

– Scale (interval,ratio): • continuousdatawithcomparablevaluesbetweendata, • e.g.ageof0‐100,populationofacity 1/18/2021

20

Levelofmeasurement • Higherlevelallowsmorepowerfulstatisticanalysis – Scale>Ordinal>Nominal • ScaledatamustbeOrdinaldata;Ordinaldatamust beNominaldata

1/18/2021

21

Task1:ImportExcelFileinSPSS variable 1, variable 2, variable 3, … 1, 10, 100, … 2, 20, 200, … 3, 30, 300, … …, …, … *.csv file

Import

Variable 1

Variable 2

Variable3



1

10

100



2

20

200



3

30

300











SPSS file

1. Doubleclick“country.csv”filetocheck 2. File>Open>Data – – – – – –

SetFilesoftype to“Allfiles”, Browse to“country.csv”toopenthefileandTextImportWizard ClickNext >Selectdelimited> Selectyes (for“Arevariableincludedatthetopofyourfile?”) ClickNext>Next>Selectcomma andDeselect otheroptions ClickNext>Next>Finish

1/18/2021

22

3.ModifytheVariablestomatchthefollowinginVariable View

1/18/2021

23

Step4and5.ValueLabel 4.Clickvaluescolumnfor“12.develop”variableandsetValueLabels: 5.Tocheckthat valuelabelworks, gotoDataView andclickthedata value button

1/18/2021

24

Step6.ValueLabel 6.InVariableView,clickValuescolumn for“11.region”variableandsetValue Labels:

25

Step7and8.AddNewCase 7.InDataView,add onemorecaseattheendof tablebytypingthefollowingdata: Variable country pop92 urban gdp lifeexpm lifeexpf birthrat deathrat infmr fertrate region develop radio phone hospbed docs lndocs lnphone sequence 1/18/2021

value NewZealand 3.347 76 14000 72 80 15 8 10 1.8 18 0 90.91 71.43 90.09 27.86 3.33 4.27 121

8.File>Savetosavethefile 26

Assignment1:DesignofDataFile • Thetableinthenextslideshowsthe demographicalinformationofaretail customerdatabase • Designadatafilewithappropriatename, label,value,measure,etc. • Keyinthedata • Savethefilewithappropriatefilenamefor futureuse 1/18/2021

27

Assignment1:DesignofDataFile(con’t) Marital Case Age Status 1 55 Married 2 56 Unmarried 3 28 Married 4 24 Married 5 25 Unmarried 6 45 Married 7 42 Unmarried 8 35 Unmarried 9 46 Unmarried 10 34 Married 11 55 Married 12 28 Unmarried 13 31 Married 14 42 Unmarried 15 35 Unmarried 16 52 Married 17 21 Married 18 32 Unmarried 19 42 Unmarried 20 40 Married 21 30 Unmarried 22 48 Unmarried 23 39 Married 24 42 Married 25 45 Married 1/18/2021

Primary Yearin Priceof vehicle current Household primary price address Income vehicle category 12 72 36.2 Luxury 29 153 76.9 Luxury 9 28 13.7 Economy 4 26 12.5 Economy 2 23 11.3 Economy 9 76 37.2 Luxury 19 40 19.8 Standard 15 57 28.2 Standard 26 24 12.2 Economy 0 89 46.1 Luxury 17 72 35.5 Luxury 3 24 11.8 Economy 9 40 21.3 Standard 8 137 68.9 Luxury 8 70 34.1 Luxury 24 159 78.9 Luxury 1 37 18.6 Standard 0 28 13.7 Economy 9 109 54.7 Luxury 12 117 58.3 Luxury 3 23 11.8 Economy 14 21 9.5 Economy 17 17 8.5 Economy 5 34 16.6 Standard 12 115 57.4 Luxury

Years LevelofEducation employed Retired JobSatisfaction Gender Didnotcompletehighschool 23 No Highlysatisfied Female Didnotcompletehighschool 35 Yes Somewhatsatisfied Male Somecollege 4 No Neutral Female Collegedegree 0 No Highlydissatisfied Male Highschooldegree 5 No Somewhatdissatisfied Male Somecollege 13 No Somewhatdissatisfied Male Somecollege 10 No Somewhatdissatisfied Male Highschooldegree 1 No Highlydissatisfied Female Didnotcompletehighschool 11 No Highlysatisfied Female Somecollege 12 No Somewhatsatisfied Male Somecollege 2 Yes Neutral Female Collegedegree 4 No Highlysatisfied Male Collegedegree 0 No Somewhatdissatisfied Female Somecollege 3 No Highlydissatisfied Female Somecollege 9 No Somewhatsatisfied Male Collegedegree 16 No Highlysatisfied Male Somecollege 0 Yes Highlydissatisfied Male Didnotcompletehighschool 2 No Somewhatsatisfied Female Somecollege 20 No Neutral Female Highschooldegree 19 No Highlysatisfied Female Didnotcompletehighschool 3 No Neutral Male Somecollege 2 No Neutral Male Collegedegree 2 No Neutral Male Highschooldegree 13 No Neutral Female Didnotcompletehighschool 27 No Somewhatsatisfied Female 28

Inthissection • Structureofthiscourse • StatisticAnalysis • SPSSInterface • VariableSettingsandLevelofMeasurement • DataTransformation • CheckDataErrorBeforeDataAnalysis 1/18/2021

29

DataTransformation • Variablesmayrequirepre‐processingbefore runninganalysis • Forexample: – takelogarithmonthedata – addanoffsettothevariable – reversethesequenceofordinaldatafrom0‐6to 6‐0

1/18/2021

30

Task: ComputeVariable • Tocomputenewvariablefromtheexistingvariables: 1. Transform >ComputeVariable 2. Totakenaturallogarithmonpop92,>FunctionGroup> Arithmetic 3. FunctionandSpecialVariables >doubleclickonLn> Doubleclickonpop92 fromthelistofvariable,you shouldseeLn(pop32)inNumericalExpression 4. Targetvariable >inputlnpop32 (newvariable)>OK Note:youmayIf… toselectthecasesforcomputation.

1/18/2021

31

Task: RecodeVariable • Createnewvariablesbydividingexisting variableintocategories • eg.classifypopulationintoclass pop92 popclass (newvariable)

1/18/2021

40

System‐ missing

1

2

3

4

5

32

Task: RecodeVariable(Con’t) • Torecodepopclass fromtheexistingvariablespop92: 1. Transform >RecodeVariableintoDifferentVariables 2. Doubleclickon pop92 >OutputVariable >setName aspopclass >set Label asPopulationClass >Change>OldandNewValues 3. SetRange,LOWESTthroughvalue to0 >System‐missing>Add toaddthe firstcategory(system‐missing) 4. SetRange as0 through10 >setvalue as1 >Add toaddthesecond category(1) 5. Repeat10‐20,20‐30,30‐40forcategory2to4 6. SetRange,valuethroughHIGHEST to40 >setvalue as5>Add toaddthe lastcategory(5) 7. >OK

1/18/2021

33

Inthissection • Structureofthiscourse • StatisticAnalysis • SPSSInterface • VariableSettingsandLevelofMeasurement • DataTransformation • CheckDataErrorBeforeDataAnalysis 1/18/2021

34

CheckDataValue– DataTable • Ifdatahaveerrors,dataanalysiswouldbeawasteoftime • Alwayscheckdataerrorbeforedataanalysis: 1. 2. 3. 4. 5. 6.

Checkduplicatecases Checkmissingorout‐of‐scopedata Checkdistinctvaluesfornominal/ordinal data Checkextremevaluethatareunreasonable Checkdistributionofvaluesforunusualfrequency Checkrelationshipsofvaluesthatareimpossible Life Life expectancy expectancy offemale ofmale

Infant Fertility Birth Deathrate mortality rate rate rate

Country

Population

GDP

Canada United States

27.351



74

81

14

‐7

7.3

1.7

256.561

22470

85

79

14

9

10

1.9

China

1169.619

360

69

72

22

7

33

2.2

China

0

19100

77

82

10

100

4

1.8

1

5

2

6

4

Region

Develop

North Developed America country Developed North country America Developing EasternAsia country Developed EasternAsia country

3

35

CheckDataValue‐ Frequency • Alwayscheckdataerrorbeforedataanalysis 1. 2. 3. 4. 5. 6.

Checkduplicatecases Checkmissingorout‐of‐scopedata Checkdistinctvaluesfornominal/ordinal data Checkextremevaluethatareunreasonable Checkdistributionofvaluesforunusualfrequency Checkrelationshipsofvaluesthatareimpossible

Frequency

Frequency Unusual frequency 2

1

A

B

C

D

E

abc

Outside normal range

missing

Missing value

Variable

Case ID

Duplicate cases

36

Task2a:CheckDataValue Identify Duplicate Cases

• Tocheckduplicatecasesof Norminal/Ordinaldata 1. 2. 3.

Data>IdentifyDuplicateCases Set DefineMatchingCasesBytoCountry >OK LookforPrimaryLast equalto0 (DuplicatedCase)forduplicatedcase

• Tosummarizedatavalues 1. 2.

Analyze>Reports>CaseSummaries Select allrequiredvariables>OK

• Tocheckdistinctvaluesfornominal/ordinal data 1. 2.

Analyze>DescriptiveSatistics> Frequency SetVariables to:region,develop >OK

CaseID

Frequency

Percent

Duplicate case

5

5%

Primarycase

95

95%

Total

100

100%

Case Summaries

CaseID

Variable2 Variable3 Variable4

Case1







Case2







Case3







Case4







Frequency

Percent

Value1

80

80%

Value2

15

15%

#?@

3

3%

Missing

2

2%

Total

100

100%

Frequency table

Valid

Task2b:CheckDataDistribution forScaleData • Checkextremevalue(insteadofalldistinctvalues) 1. Analyze>DescriptiveStatistic>Explore >Statistic > Extreme values (outliers) checkOutliers Case 2. SetDependent Listaspop92 number

• Checkdistributionofvalues 1. Graphs>LegacyDialog>Histogram 2. SetVariable togdp

Highest

Variable

Histogram Frequency

Lowest Extreme values

A

B

C

D

E

Variable

Value

1



1000

2



100

3



99

4



98

5



97

1



‐3

2



0

3



1

4



2

5



3

38

Task2c:Checkrelationshipof values •

Togeneratescatterplot: 1. 2. 3. 4. 5. 6.



Graphs>LegacyDialog>Scatter/Plot>SimpleScatter>Define SetYAxistoInfantmortalityrate,XAxistoFertilityrate >OK Doubleclicktheplottoedit UsetheElements>DataLabelModebuttontoclick adottoshow thecaseID Rightclickthedottogotothecase Whatpatternisshowninthescatterplot?

Trytogenerateanotherscatterplotforvariables:Phonesand Naturallogofphones –

Whatpatternisshowninthescatterplot? Scatter plot

Variable 2 18

1/18/2021

Variable 1

39

SelectCasesForAnalysis • Toselectasubsetofcases(eg.gdp>200)foranalysis: 1. Data >SelectCases > 2. ClickIfconditionissatisfied>If>setconditiontogdp > 200 >Continue 3. ClickFilteroutunselectedcases >OK – Whyisthereanewvariable“filter_$”afterselection? – Toremovefilter:Data >SelectCases >ClickAllcases

• To...


Similar Free PDFs