Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use <code>SPLIT FILE</code> to estimate the regressions specific for each company, example below. Note that one would likely want to consider other panel data models, and assess whether there is autocorrelation in the residuals. (This is IMO a useful approach though for exploratory analysis of multi-level models.)</p> <p>The example declares a new dataset to pipe the regression estimates to (see the <code>OUTFILE</code> subcommand on <code>REGRESSION</code>) and suppresses the other tables (with 900+ tables much of the time is spent rendering the output). If you need other statistics either omit the <code>OMS</code> that suppresses the tables, or tweak it to only show the tables you want. (You can use <code>OMS</code> to pipe other results to other datasets as well.)</p> <pre><code>************************************************************. *Making Fake data. SET SEED 10. INPUT PROGRAM. LOOP #Comp = 1 to 1000. COMPUTE #R1 = RV.NORMAL(10,2). COMPUTE #R2 = RV.NORMAL(-3,1). COMPUTE #R3 = RV.NORMAL(0,5). LOOP Year = 2003 to 2008. COMPUTE Company = #Comp. COMPUTE Rand1 = #R1. COMPUTE Rand2 = #R2. COMPUTE Rand3 = #R3. END CASE. END LOOP. END LOOP. END FILE. END INPUT PROGRAM. DATASET NAME Companies. COMPUTE x1 = RV.NORMAL(0,1). COMPUTE x2 = RV.NORMAL(0,1). COMPUTE x3 = RV.NORMAL(0,1). COMPUTE y = Rand1*x1 + Rand2*x2 + Rand3*x3 + RV.NORMAL(0,1). FORMATS Company Year (F4.0). *Now sorting cases by Company and Year, then using SPLIT file to estimate *the regression. SORT CASES BY Company Year. *Declare new set and have OMS suppress the other results. DATASET DECLARE CoeffTable. OMS /SELECT TABLES /IF COMMANDS = 'Regression' /DESTINATION VIEWER = NO. *Now split file to get the coefficients. SPLIT FILE BY Company. REGRESSION /DEPENDENT y /METHOD=ENTER x1 x2 x3 /SAVE PRED (CompSpePred) /OUTFILE = COVB ('CoeffTable'). SPLIT FILE OFF. OMSEND. ************************************************************. </code></pre>
    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. This table or related slice is empty.
    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