Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This syntax should do the trick. There is no need to migrate back and forth between SPSS and R solely for this task.</p> <pre><code>*making fake data, 4 million records and 150 variables. input program. loop i = 1 to 4000000. end case. end loop. end file. end input program. dataset name Temp. execute. vector X(150). do repeat X = X1 to X150. compute X = RV.NORMAL(0,1). end repeat. *This is the command you are interested in, puts the stats table into a new dataset. Dataset declare IQR. OMS /SELECT TABLES /IF SUBTYPES = 'Statistics' /DESTINATION FORMAT = SAV outfile = 'IQR' VIEWER=NO. freq var = X1 /format = notable /ntiles = 4. OMSEND. </code></pre> <p>This takes along time still with such a large dataset, but thats to be expected. Just search the SPSS help files for "OMS" to find the example syntax with how OMS works.</p> <hr> <p>Given the further constraint that you want to calculate the IQR for many groups, there is a few different ways I could see to proceed. One would be just use the split file command and run the above frequency command again.</p> <pre><code>split file by group. freq var = X1 X2 /format = notable /ntiles = 4. split file end. </code></pre> <p>You could also get specific percentiles within ctables (and can do whatever grouping/nesting you want for that). Potentially a more useful solution at this point though is to make a program that actually saves separate files (or reduces the full dataset the specific group while still loaded), does the calculation on each separate file and dumps it into a dataset. Working with the dataset that has the 4 million records is a pain, and it does not appear to be necessary if you are just splitting the file up anyway. This could be accomplished via macro commands. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload