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. Creates and accesses common directory for saved formats (including one for IAT subexclusion criteria). 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.
Documented Cleaning Script for use with the data files accessed via 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. PI folks—please contact me if you have any questions about this script.

General Use

Graphs a given F-distribution curve (PDF), with specified observed and critical value(s) (.R)
Edit of HH package (F.setup / F.curve / F.observed), to optimize display in PowerPoint/lecture notes. Aid for teaching purposes, illustrates what the "tabled" critical values in the back of statistics textbooks are showing and how to determine the "approximate" p-value for a statistical test, using tabled values. Usage example #1.
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 hypothesis of no relationship among the variables) after simulating factor analysis within 100 randomly-generated datasets with your dimensions. There's ways of doing this in SAS too (google for parallel analysis). See DataVerse supplement to Lindner & Nosek (2009) for an example of the figure and a write-up of all results.
Macro for dataset management - Range of date(time) and ID values for a given variable (.sas)
For a large dataset with many variables that appear during different time periods. You specify a variable, the macro determines the first and last values of the (a) observation/user ID and (b) date/datetime variable (specified by you). Prints to the output window only the variable name and the formatted beginning and ending duration values of user_ID and the date variable.
Macro for dataset management - Dynamically generate a monthly tabulated report of traffic/participation/etc. (.sas)
Given a date, tabulates a "traffic" report for the proceeding full month periods (specified by user). To do so, it dynamically creates a datetime format for the specified number of months, so datetime values within a month are consolidated. A tabular report for a given (formatted) row-variable (specified by user) is generated, with monthly traffic in the columns.
Hierarchical GLM with eta-partial-squared 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).
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))
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. Calculates the time spent on given task(s), as a difference score of the task commencement and commencement of the next task, before transposing the file for a datafile with one line/row per participant. Formats the difference score in an understandable time format. Graphically represents (via histograms) the results, with understandable time formatting.
Code Snippets (more coming soon)
Creates a custom datetime picture format that Google Docs recognizes (.sas)