Nicole M Lindner

“Science is a way of thinking much more than it is a body of knowledge.” – Carl Sagan

SAS and R Scripts

Specific to other Project Implicit researchers

Formats demographics variables from Project Implicit (.sas)
Shows how to create labels for character and numeric variables and use them to label output from PROCedures. Also contains an example of how to use SAS's default country/continent formats (the labels stored in SASHELP.MAPFMTS, poorly-documented in SAS) to label country codes, which are 99% standard ISO-2 codes. Contains the following features:
a. Creates and accesses common directory for saved formats
b. Creates format to label procedure output for Project Implicit Demonstraton and Research Site demographics variables I've worked with
c. Applies the formats to label procedure output
d. In conjunction with if-then-else statements in the documented cleaning script, labels a standard set of criteria (Footnote 4: Nosek, Smyth, Hansen, Devos, Lindner, Ranganath et al., 2007) for excluding IAT scores
Documented Cleaning Script for use with the data files accessed via the Beta-version of the RDE/Virtual Lab (.sas)
For now, useful only to those with accounts on the Project Implicit wiki (or the RDE) because it is specific to our database's structure and formatting (though anyone may download it). For collaborators, this script documents how to clean, transpose, and merge (for substantive analysis) the standard datafiles available through Project Implicit's RDE. When transposing, it can optionally obtain some useful information (time spent on a task, sequence of implicit/explicit/other tasks within the study, etc.).For the IAT, it cleans, reverse-codes, checks for problem participants/trials, and the like in preparation for substantive analysis
Datetime difference scores, graphically exploring the results (.sas)
For datasets with one row per task begun by a given participant, with a column indicating the time begun as a SAS datetime variable (number of seconds since January 1, 1960. No, I couldn't make this up if I tried).
Calculates the time spent on given task(s), as a difference score between the time a task was begun and the time a later task was begun, before transposing the file for a datafile with one line/row per participant. Formats the difference score in an understandable time format (number of hours / seconds/ etc., with documentation of where additional formats can be located). Applies time formatting to the difference score and graphically represents (via histograms) the results.

SAS: General Use

Hierarchical GLM with ηp2 and summary of results (ZIP)
Summarizes (as HTML) the results of hierarchical regression analysis, with ηp2, regression coefficients, and 95% confidence limits. Readies the results for presentation in Excel with the provided template, Includes the necessary SAS script, the output produced by that script, and an Excel spreadsheet template in which to copy and paste the SAS output (HTML files can be opened in Excel for ease of use; see ReadMe).
Easy(-ish) Graphing in SAS (.sas)
Uses SAS' new (?) ACTIVEX driver to generate a simple graph. With this, one can then right-click to change axes/ ranges, colors, labels, interpolation lines, etc. (similar to SPSS). Includes examples of several graphs:
a. Simplified version of 2x2 anova with defaults
b. From SAS-Help Area bar, with subgrouping
c. Comparative histogram - Plots the distribution of data across a given class variable
Graphing in SAS - vector-based for integration with PowerPoint (.sas)
Uses the SASEMF graphics driver to generate publication-ready (high-quality, Arial font) graphs within SAS. Unlike other drivers, these can can easily be "ungrouped" into modifiable vectors within Microsoft PowerPoint for reformatting / relabeling (insert the created .EMF graph as a picture, and ungroup). That is, you can thicken or change the line type of line-chart elements easily, unlike SAS' other vector-based devices.
Make sure that you view the generated EMF file, not the SAS GRAPH window to view the graph as it will appear when imported.
ALSO: Registers all readable Windows fonts (for Windows XP Professional) so that they can be used in graphs.
ALSO: Identifies a folder where all graphs will be saved (optionally, with a specified name for the PROCedure's graph(s))
Principal factor analysis, bootstrapping eigen cut-offs (.sas and .R)
Conducts PFA in SAS, then uses R to estimate eigen value cut-offs. See Russell (2002, PSPB) for details, but in short, this uses bootstrap estimation to calculate the average “null” eigen values (e.g., the null condition of no relationship among the variables) after simulating factor analysis within 100 randomly-generated datasets with your dimensions. See DataVerse Supplement to Lindner & Nosek (2009) for an example of the figure and a write-up of results.
NOTE: Full supplement with this script and a write-up of all results on DataVerse
NOTE: Intended only to demonstrate how to follow Russell's (2002) recommendations. It is adapted from the line of code in Russell (2002), Footnote 6. As an R novice, the script in Russell was difficult to follow. Russell recommended that a full script be downloaded from the R-Project's source files, but I still can't locate it. Per Russell's citation, I consulted Reise, Waller, & Comfrey (2000), but had trouble with their R code (when using copy and paste). Thus, I've simplified its use for SAS users. This is a SAS script, with a section of R-code that can be copied and pasted in to R for immediate use or can be saved separately as a .R script.