1 / 33

SPSS … The when and why of Syntax

SPSS … The when and why of Syntax. JENA GRADUATE ACADEMY Dr. Friedrich Funke. Before we start …. What is the »philosophy« behind my approach?. Self Empowerment !. Development assistance ?.

mclelland
Télécharger la présentation

SPSS … The when and why of Syntax

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SPSS …The whenandwhyof Syntax JENA GRADUATE ACADEMY Dr. Friedrich Funke

  2. Before we start … What is the »philosophy« behind my approach? SelfEmpowerment! Development assistance?

  3. Learning Objectives – What do you expect? Frustration is the disappointment of expectations Whatis YOUR point?

  4. Learning Objectives What will you have learnt today? • What is Syntax • How do I get it • Why and when do I use it • Examples • Makros and Skripts • Helpful ressources

  5. What is Syntax? MVA VARIABLES = set_quest_T1 set_quest_T2 set_quest_bothset_migration set_countryset_consistentset_subsamplesset_unit_missingness set_wavefilter_T1 set_wavefilter_T2 /MAXCAT = 25 /CATEGORICAL = set_subsamplesset_unit_missingness set_wavefilter_T1 set_wavefilter_T2 /TTEST PROB PERCENT=5 /CROSSTAB PERCENT=5 /MISMATCH PERCENT=5 /DPATTERN DESCRIBE=set_quest_T1 set_quest_T2 set_quest_bothset_migration set_countryset_consistentset_subsamplesset_unit_missingness set_wavefilter_T1 set_wavefilter_T2 /MPATTERN DESCRIBE=set_quest_T1 set_quest_T2 set_quest_bothset_migration set_countryset_consistentset_subsamplesset_unit_missingness set_wavefilter_T1 set_wavefilter_T2 /TPATTERN PERCENT=1 DESCRIBE=set_quest_T1 set_quest_T2 set_quest_both set_migrationset_countryset_consistentset_subsamplesset_unit_missingness set_wavefilter_T1 set_wavefilter_T2 /LISTWISE /PAIRWISE /EM ( TOLERANCE=0.001 CONVERGENCE=0.0001 ITERATIONS=25 ) /REGRESSION ( TOLERANCE=0.001 FLIMIT=4.0 ADDTYPE=RESIDUAL ) .

  6. What is Syntax? Command Subcommand Subcommand = KEYWORD Subcommand = Specification T-TEST GROUPS = gender_both(1 2) /MISSING = ANALYSIS /VARIABLES = prejud_t1 /CRITERIA = CI(.95) . Anyideaswhatisdonehere?

  7. Structure of Syntax The example syntax can be used to generate descriptive statistics:       DESCRIPTIVES        VARIABLES=educ        /STATISTICS=MEAN STDDEV MIN MAX . First, know the difference between commands and subcommands. The command name is always on the first line. If it is a procedure that generates statistical output, then the names of variables to be included in the analysis will immediately follow. Here, the command name is DESCRIPTIVES followed by the subcommand, VARIABLES, on the following line. After the VARIABLES subcommand, the variable name educ appears, which tells the SPSS processor the variable on which to calculate descriptive statistics. This could also be a list of variables if you want to generate statistics on more than one variable at a time. The /STATISTICS subcommand also illustrates the use of options in a subcommand. Following the equals sign, there is a list of four statistics, MEAN STDDEV MIN MAX, which are four of several possible descriptive statistics that can be specified in this command. Notice the period following the last line of the above code. It indicates the end of a command and is always  placed after the last subcommand for a particular procedure.

  8. Do I have to learn a thousand new commands? Fortunately: no!

  9. How to obtain Syntax GUI Results syntax

  10. How to obtain Syntax

  11. How to obtain Syntax GUI Results syntax Remindme in the end ofthesession, that I reveal a littlesecretaboutthehiddensyntax!

  12. How to obtain Syntax GUI Results syntax T-TEST GROUPS = gender_both(1 2) /MISSING = ANALYSIS /VARIABLES = prejud_t1 /CRITERIA = CI(.95) . syntax Results Run

  13. How to obtain Syntax GUI Results syntax syntax Results Run GUI syntax Results Paste Run

  14. How to obtain Syntax GUI syntax Results Paste Run GUI syntax Results Paste Run Excel modify

  15. Excel as a mighty editor

  16. How to obtain Syntax Integratesyntaxfiles in macros, scriptsand 3rd partysoftware GUI Results syntax syntax Results Run GUI syntax Results Paste Run GUI syntax Results Paste Run Excel modify syntax Results batch syntax syntax

  17. Production facility The Production Facility The Production Facility is an application that stands apart from the standard SPSS application. It can be accessed from the Window's Start menu. The Production Facility's primary purpose is to process syntax files in batch mode. You can process as many syntax files as you like by using the Add button to add syntax files to the list of files in the Syntax Files box

  18. Macros Macros SPSS provides the capability to create macros that contain text and SPSS command syntax. Macros can perform the same command repeatedly, combine several procedures, or calculate user-defined statistics. Any functions you can perform using SPSS syntax can be incorporated into a macro. When a macro is called, it is expanded so that any text including commands will be used in its place. There are two commands used to create a macro: DEFINE and !ENDDEFINE. To begin the definition of a macro, type the DEFINE commandin the Syntax Editor followed immediately by the user-defined macro name. Be careful in choosing this name as it will activate the macro whenever it is used. It should be a name that does not appear elsewhere in your syntax. Following the user-defined macro name are parentheses. These required parentheses may or may not contain parameters. Next, you can type syntax or any other text that will be called each time your macro is called. After you have entered all of the text or syntax that you want to include in your macro, type !ENDDEFINE to end the definition. The following syntax illustrates the use of a macro that contains a list of variables names. The macro is then used in the DESCRIPTIVES procedure. DEFINE varlist ()              educ jobcat salary salbegin jobtime !ENDDEFINE. DESCRIPTIVES         VARIABLES=varlist .

  19. Macros       DEFINE varlist () educjobcat salary salbeginjobtime      !ENDDEFINE.       DEFINE descrip ()       DESCRIPTIVES              VARIABLES=varlist      !ENDDEFINE.       DESCRIP. • The above macro is identical to the prior example except that the DESCRIPTIVES command has been included in a new macro called descrip, which is then called after the macro definition

  20. Scripts Scripts using Visual Basic The SPSS scripting facility enables you to add numerous custom features to SPSS. It uses the Visual Basic programming language to operate on most any feature of the SPSS environment. You can use any commands available in Visual Basic in addition to the Visual Basic commands that are unique to SPSS's scripting facility.

  21. Do I have to learn a thousand new commands? Fortunately: no!

  22. http://www.spsstools.net/

  23. http://www.spss.com/spss/SPSSdatamgmt_4e.pdf

  24. Special Scripts and Macros http://www.comm.ohio-state.edu/ahayes/SPSS%20programs/indirect.htm

  25. http://spss.wikia.com/wiki/SPSS_Wiki

  26. SPSS …The whenandwhyof SyntaxSummary JENA GRADUATE ACADEMY Dr. Friedrich Funke

  27. When and why should we use Syntax? • More efficient with large datasets • Exclusive commands for special analyses • ReUsage of common algorithms • Documentation • More conscious use of statistics

  28. Feedback and Giveaway of the day

More Related