如何在SPSS语法中添加“return”?

时间:2012-09-05 21:04:01

标签: spss

我为OLS编写了以下SPSS语法。对我来说,这很容易阅读。不同的变量分为一行,注释描述它们是什么:

/* model (3d) hbs returns IV, lag DV, IV lag 1 and 2
REGRESSION 
  /MISSING LISTWISE 
  /STATISTICS COEFF OUTS R ANOVA 
  /CRITERIA=PIN(.05) POUT(.10) 
  /NOORIGIN 
  /DEPENDENT retExc0
  /METHOD=ENTER 
  hbsVol0LN hbsBullQuality0 hbsAgreeQuality0 wiki0LN svi0 /* independent
  retExc1 retExc2 /* lag dependent
  hbsVol1LN hbsBullQuality1 hbsAgreeQuality1 Wiki1LN svi1 /* lag 1 independent
  hbsVol2LN hbsBullQuality2 hbsAgreeQuality2 Wiki2LN svi2 /* lag 2 independent
  secEnergy secMat secIndus secConsS secHealth secFin secIT secTelco secUtil /* control
  dayMon dayTue dayWed dayFri /* control
  news
  marketRet0 
  day01 day02 day03 day04 day05 day06 day07 day08 day09 day10 day11 day12 day13 day14 day15 day16 day17 day18 day19 day20 day21 day22 day23 day24 day25 day26 day27 day28 day29 day30 day31
  /RESIDUALS DURBIN.

然而,语法解释器不接受这一点,它希望在回归/MEHOD之后直接跟随所有变量:

/* model (3d) hbs returns IV, lag DV, IV lag 1 and 2
REGRESSION 
  /MISSING LISTWISE 
  /STATISTICS COEFF OUTS R ANOVA 
  /CRITERIA=PIN(.05) POUT(.10) 
  /NOORIGIN 
  /DEPENDENT retExc0
  /METHOD=ENTER hbsVol0LN hbsBullQuality0 hbsAgreeQuality0 wiki0LN svi0 retExc1 retExc2 hbsVol1LN hbsBullQuality1 hbsAgreeQuality1 Wiki1LN svi1 hbsVol2LN hbsBullQuality2 hbsAgreeQuality2 Wiki2LN svi2 secEnergy secMat secIndus secConsS secHealth secFin secIT secTelco secUtil dayMon dayTue dayWed dayFri news marketRet0 day01 day02 day03 day04 day05 day06 day07 day08 day09 day10 day11 day12 day13 day14 day15 day16 day17 day18 day19 day20 day21 day22 day23 day24 day25 day26 day27 day28 day29 day30 day31
  /RESIDUALS DURBIN.

然而,这看起来并不容易维护。如何连接变量行以便解释器接受我的原始输入,例如:

/* model (3d) hbs returns IV, lag DV, IV lag 1 and 2
REGRESSION 
  /MISSING LISTWISE 
  /STATISTICS COEFF OUTS R ANOVA 
  /CRITERIA=PIN(.05) POUT(.10) 
  /NOORIGIN 
  /DEPENDENT retExc0
  /METHOD=ENTER ;
  hbsVol0LN hbsBullQuality0 hbsAgreeQuality0 wiki0LN svi0 ;
  retExc1 retExc2 ;
  hbsVol1LN hbsBullQuality1 hbsAgreeQuality1 Wiki1LN svi1 ;
  hbsVol2LN hbsBullQuality2 hbsAgreeQuality2 Wiki2LN svi2 ;
  secEnergy secMat secIndus secConsS secHealth secFin secIT secTelco secUtil ;
  dayMon dayTue dayWed dayFri ;
  news ;
  marketRet0 ;
  day01 day02 day03 day04 day05 day06 day07 day08 day09 day10 day11 day12 day13 day14 day15 day16 day17 day18 day19 day20 day21 day22 day23 day24 day25 day26 day27 day28 day29 day30 day31
  /RESIDUALS DURBIN.

这样的事情是可能的,如果是这样,怎么样?

2 个答案:

答案 0 :(得分:1)

我没有遇到任何与您的结构相同的语法错误。它运作正常。

/* model (3d) hbs returns IV, lag DV, IV lag 1 and 2.
REGRESSION 
  /MISSING LISTWISE 
  /STATISTICS COEFF OUTS R ANOVA 
  /CRITERIA=PIN(.05) POUT(.10) 
  /NOORIGIN 
  /DEPENDENT y
  /METHOD=ENTER 
  x1 x2 x3 /* independent
  x4 x5 /* lag dependent
  x6 x7 x8 x9 /* lag 1 independent
  x10 x11 x12 x13 /* lag 2 independent
  x14 x15 x16 /* control
  x17 x18 x19 /* control
  x20
  x21 
  x23 x24 x25 x26 x27 x28 x29 x30
  /RESIDUALS DURBIN.

答案 1 :(得分:1)

在Statistics语法中完全可以接受换行符。如果您发布了实际的错误消息,这将有所帮助。也许在一条线上有一个非打印字符让事情变得混乱。

一个完全空行终止命令,但这似乎不是这种情况。

通常,在交互模式(甚至生产语法通常使用)中,命令会一直持续到空白行或终止时段,换行符不相关。 (多行文字需要额外注意。)