You are here
Home ›Importing Data
To import data into a statistical software package, users should have downloaded their custom data set files from the Investigator website. Instructions for the download process are located in the Save/Download Tab section of the Investigator User Guide.
STATA
STATA users will use the .DCT or Dictionary file to import data, which is part of the basic download.
- In STATA, choose: File > Import > Text data in fixed format with a dictionary
- Browse to find the .DCT file
- Select the file and click open, then click OK
Use the summarize command to see a table of descriptive statistics.
SPSS
SPSS users will use the syntax file to import data, which is part of the basic download.
- In SPSS, choose: File > Open > Syntax
- Select the syntax file and click open
- Update the file handle on the first line to the complete directory path (on your computer) to the .DAT file.
- By default, the file handle reads:
file handle pcdat/name='filename.dat' /lrecl=36 - Once updated, it will have a detailed directory path similar to this example:
file handle pcdat/name='C:\Documents\sample-data\filename.dat' /lrecl=36
- By default, the file handle reads:
- Run all.
Once complete, the syntax editor will display a table of descriptive statistics and the data will be loaded in the statistical viewer (output window).
R
R users will use the R file to import data, which is part of the advanced download.
- In R, choose: File > Open File
- Select the R file and click open
- Next, set the working directory (line 3), example: setwd('C:/Documents/sample-data/')
- NOTE: Windows directory paths use \ (backward) slashes and R requires / (forward) slashes. If copy/pasting a Windows directory path, the slashes should be updated to avoid run time errors.
- Delete the # in front of the setwd() on line 3 before running the code.
- Click run at the top of the script file.
The console will display descriptive statistics once complete. To view a spreadsheet of the data, type: View(new_data) in the console window and click run.
SAS
SAS users will use the program file to import data, which is part of the basic download.
- In SAS, choose: File > Open Program
- Once the program is open, update the infile code with the full directory path.
- By default, the infile reads:
infile 'filename.dat' lrecl=21 missover DSD DLM=' ' print; - Once updated, it will have a detailed directory path similar to this example:
infile 'C:\Documents\sample-data\filename.dat' lrecl=21 missover DSD DLM=' ' print;
- By default, the infile reads:
- For users with SAS 9.3 or older, run the program as is.
- For those with version 9.4, delete the latter portion of the infile code before running the program.
- Example: infile 'C:\Documents\sample-data\filename.dat';
Once the program is complete, a table of descriptive statistics will appear.
Finding the Full Directory Path
Windows
Two ways to get the full directory path:
Navigate in the Windows File Explorer to the folder with your data files.
- Click in the address bar and copy the directory path, or
- Right-click on the .DAT file, choose properties, and then copy the location.
Mac
Two ways to get the full directory path:
Open Finder and select the folder with your data set files.
- While the folder is selected, press command+i to open the Get Info window. Copy the directory path listed next to where, or
- Open the Terminal and drag the folder into the Terminal window. This will output the full path of the folder.
Video Tutorial
A video tutorial demonstrating the import process is available on the Video Tutorials page of the Investigator User Guide.
<< Previous | Table of Contents | Glossary | Next >>