00:00:08:09 - 00:00:34:04 Narrator This video will demonstrate how to import variables from the NLS Investigator into your statistical software. At this point, your variable search should be complete and variables tagged. A list of tagged variables will appear in the Review Selected Variables tab. To download your custom dataset, click the Save Download tab. For most users, the Basic Download tab will provide the necessary formats. 00:00:34:07 - 00:01:06:08 Narrator For those using R, click the Advanced Download tab and select the R source code. Next, enter a filename and click the download button to prepare the files. Once the files are ready, the Manage Download tab will provide a link to start the download process. After your zip folder has downloaded, extract the files to begin the import process. 00:01:06:10 - 00:01:42:01 Narrator Stata users will import the DCT or dictionary file. In Stata, choose file import text data in a fixed format with a dictionary. Choose the browse option and navigate to the dataset folder that you downloaded. Click on the DCT file, click open, and click OK. You will now see your variables loaded to the right, and may run a 'summarize' command... to see a basic descriptive stats table. 00:01:42:03 - 00:02:11:01 Narrator All of the dataset files are ASCII format, so they can be opened with any text editor. This is useful for Stata if you would like to replace the Investigator given variable names with descriptive terms. For example, I will open up with notepad... and give a descriptive term for each R number that was used as a variable name. 00:02:11:03 - 00:02:47:25 Narrator Re-save the file, go back into Stata. I will clear my dataset. File, import, text data with the dictionary file, browse, select the file that I updated, click ok and you'll see that my variable names have been updated. I can now rerun my 'summarize' command and I have descriptive terms in my variable list. 00:02:47:27 - 00:03:25:22 Narrator SPSS users will import the syntax file. In SPSS, Choose File Open Syntax and navigate to your downloaded dataset files. Choose the syntax file and click open. The syntax file will open in the syntax editor. The first item is to change the file handle directory. It will currently only list the filename for the Dat file. To get the full directory name, navigate to your folder using the files explorer on Windows and click in the address bar to copy the full directory. 00:03:25:25 - 00:04:00:10 Narrator Another way to get the directory path is to right click on the DAT filename, choose properties, and copy the location. Once you have the directory path, return to the syntax window and paste... the directory path right before the filename. Making sure that you add an additional slash between the folder name and the filename. Then select run. 00:04:00:13 - 00:04:07:04 Narrator Once the file has run, you will see a descriptive stats table. 00:04:07:07 - 00:04:13:12 Narrator And your data will be loaded into the data editor. 00:04:13:14 - 00:04:41:21 Narrator Note in the syntax editor, the file has several code items that are commented out that users may find helpful. One of those items is the value labels. The value labels provide additional context for variable values. For example, in the sex variable, the label for 1 is male. The label for 2 is female. In some instances, the value labels may be very long, in which SPSS may truncate them. 00:04:41:27 - 00:04:49:14 Narrator To use the value label, simply delete the asterisk. 00:04:49:16 - 00:05:19:27 Narrator A second item that users might be interested in is the rename variables. By default, Investigator gives the user the option to download 'by RNUM' or by Qname with survey year'. If users would like to use a more descriptive term for their variable names, the rename variable code will allow them to change those names. 00:05:20:00 - 00:05:28:15 Narrator Once the additional code has been updated, you can run, choose all... 00:05:28:18 - 00:05:44:27 Narrator and when you open up the data editor, you will see that your variable names have been updated to the descriptive terms that you have chosen. 00:05:45:00 - 00:06:16:25 Narrator R users have access to an R file through the Investigator by using the Advanced Download feature. Once in R, choose file, open file, and navigate to your downloaded datasets. Click on the R file, choose open and it will load in your R file. The main item to address is the set working directory. The easiest way to find the directory path is to go to the Windows File Explorer, 00:06:17:02 - 00:06:50:08 Narrator navigate to your folder, and click on the address bar to copy the directory path. You may also right click on the file, choose properties, and copy the location. Note that Windows uses back slashes for its directory path and R requires forward slashes. I'll start by placing in my quotes... between the quotes, pasting the directory path, and then updating the backward slashes to forward slashes. 00:06:50:10 - 00:07:23:26 Narrator Once the directory path is updated, you can uncomment the line by deleting the pound sign. Select all and choose run. In the console you will see descriptive statistics using the 'summary' command and the variable 'new_data' which is provided by Investigator in the R file. To view the data, use view and the variable new_data, 00:07:23:28 - 00:07:37:18 Narrator and run. This will give you a view of all the data points for the different variables that you have downloaded. 00:07:37:20 - 00:08:06:16 Narrator For SAS users, Investigator provides a program file to import the data. In SAS, Choose file, open program, and navigate to the downloaded data files. Choose your program file and click open. Once the file is opened in the editor, you will need to update the 'infile' line of code. It currently lists the filename for the Dat file and needs the complete directory path to get the directory path. 00:08:06:18 - 00:08:26:22 Narrator Open your Windows Explorer and navigate to the folder with your data files. Click in the address bar and copy the directory path. You may also right click on the file, choose properties, and copy the location. 00:08:26:25 - 00:09:02:08 Narrator In the SAS editor, paste the directory and add a back slash between your folder name and the dat filename. For users on 9.3 or older, you can run the code as is. For users that have 9.4 as their version, you will need to delete the latter half of the line, leaving the semicolon in place. Click run and once the file is complete, you will see a table of descriptive statistics based on the variables you downloaded from Investigator.