Regression Plot

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Regression Plot

Jim Moffitt
I've provided some sample data and syntax for a simple regression below.
Why doesn't this syntax place a regression line on the scatter plot?
Thanks for your help.
 
DATA LIST LIST (",") / id PV DV.

BEGIN DATA

1, 14446.46, 16805.39

2, 6859.16, 8548.855

3, 9047.168, 13970.22

4, 6223.49, 4113.97

5, 4174.713, 5240.393

6, 12841.06, 19831.86

7, 3479.56, 6103.02

8, 4420.92, 7311.133

9, 4045.598, 5653.97

10, 7870.713, 10863.16

11, 7780.168, 9685.883

12, 4764.9, 5674.218

13, 9021.653, 17196.6

14, 3858.138, 9747.5

15, 5909.26, 7716.153

16, 3449.6, 4691.05

17, 4792.27, 5921.213

18, 5628.455, 7146.003

19, 14680.79, 20397.42

20, 9411.15, 9784.128

21, 3608.57, 6029.135

22, 5049.993, 7407.838

23, 20376.79, 26801.72

24, 7225.243, 12004.56

25, 21161.44, 30835.26

26, 3915.59, 4980.693

27, 6209.753, 7135.8

28, 6545.158, 7568.785

29, 9981.37, 12325.64

30, 6847.505, 10249.42

31, 3250.38, 3545.745

32, 13681.43, 17206.7

33, 2331.683, 4585.84

34, 3532.55, 4686.168

END DATA.

REGRESSION

  /MISSING LISTWISE

  /STATISTICS COEFF OUTS R ANOVA

  /CRITERIA=PIN(.05) POUT(.10)

  /NOORIGIN

  /DEPENDENT DV

  /METHOD=ENTER PV  .

IGRAPH /VIEWNAME='Scatterplot' /X1 = VAR(Metric) TYPE = CATEGORICAL /Y =

  VAR(DV) TYPE = SCALE /COORDINATE = VERTICAL  /FITLINE METHOD =

  REGRESSION LINEAR LINE = TOTAL SPIKE=OFF /X1LENGTH=3.0 /YLENGTH=3.0

 /X2LENGTH=3.0 /CHARTLOOK='NONE' /CATORDER VAR(Metric) (ASCENDING VALUES

  OMITEMPTY) /SCATTER COINCIDENT = NONE.

EXE.

.
Reply | Threaded
Open this post in threaded view
|

Re: Regression Plot

Raynald Levesque
Hi

The following works:

IGRAPH /VIEWNAME='Scatterplot'
  /X1 = VAR(PV) TYPE = SCALE
  /Y = VAR(DV) TYPE = SCALE
  /COORDINATE = VERTICAL
  /FITLINE METHOD = REGRESSION LINEAR LINE = TOTAL SPIKE=OFF
  /X1LENGTH=3.0
  /YLENGTH=3.0
  /X2LENGTH=3.0
  /CHARTLOOK='NONE' /SCATTER COINCIDENT = NONE.

Regards,

Raynald Levesque [hidden email]
Website: www.spsstools.net

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jim
Moffitt
Sent: April 6, 2007 4:19 PM
To: [hidden email]
Subject: Regression Plot

I've provided some sample data and syntax for a simple regression below.
Why doesn't this syntax place a regression line on the scatter plot?
Thanks for your help.

DATA LIST LIST (",") / id PV DV.

BEGIN DATA

1, 14446.46, 16805.39

2, 6859.16, 8548.855

3, 9047.168, 13970.22

4, 6223.49, 4113.97

5, 4174.713, 5240.393

6, 12841.06, 19831.86

7, 3479.56, 6103.02

8, 4420.92, 7311.133

9, 4045.598, 5653.97

10, 7870.713, 10863.16

11, 7780.168, 9685.883

12, 4764.9, 5674.218

13, 9021.653, 17196.6

14, 3858.138, 9747.5

15, 5909.26, 7716.153

16, 3449.6, 4691.05

17, 4792.27, 5921.213

18, 5628.455, 7146.003

19, 14680.79, 20397.42

20, 9411.15, 9784.128

21, 3608.57, 6029.135

22, 5049.993, 7407.838

23, 20376.79, 26801.72

24, 7225.243, 12004.56

25, 21161.44, 30835.26

26, 3915.59, 4980.693

27, 6209.753, 7135.8

28, 6545.158, 7568.785

29, 9981.37, 12325.64

30, 6847.505, 10249.42

31, 3250.38, 3545.745

32, 13681.43, 17206.7

33, 2331.683, 4585.84

34, 3532.55, 4686.168

END DATA.

REGRESSION

  /MISSING LISTWISE

  /STATISTICS COEFF OUTS R ANOVA

  /CRITERIA=PIN(.05) POUT(.10)

  /NOORIGIN

  /DEPENDENT DV

  /METHOD=ENTER PV  .

IGRAPH /VIEWNAME='Scatterplot' /X1 = VAR(Metric) TYPE = CATEGORICAL /Y =

  VAR(DV) TYPE = SCALE /COORDINATE = VERTICAL  /FITLINE METHOD =

  REGRESSION LINEAR LINE = TOTAL SPIKE=OFF /X1LENGTH=3.0 /YLENGTH=3.0

 /X2LENGTH=3.0 /CHARTLOOK='NONE' /CATORDER VAR(Metric) (ASCENDING VALUES

  OMITEMPTY) /SCATTER COINCIDENT = NONE.

EXE.

.
Reply | Threaded
Open this post in threaded view
|

Re: Regression Plot

Beadle, ViAnn
In reply to this post by Jim Moffitt
When I run this, (after removing all the blank lines) I get syntax error pointing to an invalid variable name called metric on the IGRAPH command.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jim Moffitt
Sent: Friday, April 06, 2007 3:19 PM
To: [hidden email]
Subject: Regression Plot

I've provided some sample data and syntax for a simple regression below.
Why doesn't this syntax place a regression line on the scatter plot?
Thanks for your help.

DATA LIST LIST (",") / id PV DV.

BEGIN DATA

1, 14446.46, 16805.39

2, 6859.16, 8548.855

3, 9047.168, 13970.22

4, 6223.49, 4113.97

5, 4174.713, 5240.393

6, 12841.06, 19831.86

7, 3479.56, 6103.02

8, 4420.92, 7311.133

9, 4045.598, 5653.97

10, 7870.713, 10863.16

11, 7780.168, 9685.883

12, 4764.9, 5674.218

13, 9021.653, 17196.6

14, 3858.138, 9747.5

15, 5909.26, 7716.153

16, 3449.6, 4691.05

17, 4792.27, 5921.213

18, 5628.455, 7146.003

19, 14680.79, 20397.42

20, 9411.15, 9784.128

21, 3608.57, 6029.135

22, 5049.993, 7407.838

23, 20376.79, 26801.72

24, 7225.243, 12004.56

25, 21161.44, 30835.26

26, 3915.59, 4980.693

27, 6209.753, 7135.8

28, 6545.158, 7568.785

29, 9981.37, 12325.64

30, 6847.505, 10249.42

31, 3250.38, 3545.745

32, 13681.43, 17206.7

33, 2331.683, 4585.84

34, 3532.55, 4686.168

END DATA.

REGRESSION

  /MISSING LISTWISE

  /STATISTICS COEFF OUTS R ANOVA

  /CRITERIA=PIN(.05) POUT(.10)

  /NOORIGIN

  /DEPENDENT DV

  /METHOD=ENTER PV  .

IGRAPH /VIEWNAME='Scatterplot' /X1 = VAR(Metric) TYPE = CATEGORICAL /Y =

  VAR(DV) TYPE = SCALE /COORDINATE = VERTICAL  /FITLINE METHOD =

  REGRESSION LINEAR LINE = TOTAL SPIKE=OFF /X1LENGTH=3.0 /YLENGTH=3.0

 /X2LENGTH=3.0 /CHARTLOOK='NONE' /CATORDER VAR(Metric) (ASCENDING VALUES

  OMITEMPTY) /SCATTER COINCIDENT = NONE.

EXE.

.
Reply | Threaded
Open this post in threaded view
|

Re: Regression Plot

Jim Moffitt
Sorry about that. I guess it's time to call it a week. Thanks for your
help, ViAnn.

-----Original Message-----
From: Beadle, ViAnn [mailto:[hidden email]]
Sent: Friday, April 06, 2007 3:57 PM
To: Moffitt, James (West); [hidden email]
Subject: RE: Regression Plot

When I run this, (after removing all the blank lines) I get syntax error
pointing to an invalid variable name called metric on the IGRAPH
command.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Jim Moffitt
Sent: Friday, April 06, 2007 3:19 PM
To: [hidden email]
Subject: Regression Plot

I've provided some sample data and syntax for a simple regression below.
Why doesn't this syntax place a regression line on the scatter plot?
Thanks for your help.

DATA LIST LIST (",") / id PV DV.

BEGIN DATA

1, 14446.46, 16805.39

2, 6859.16, 8548.855

3, 9047.168, 13970.22

4, 6223.49, 4113.97

5, 4174.713, 5240.393

6, 12841.06, 19831.86

7, 3479.56, 6103.02

8, 4420.92, 7311.133

9, 4045.598, 5653.97

10, 7870.713, 10863.16

11, 7780.168, 9685.883

12, 4764.9, 5674.218

13, 9021.653, 17196.6

14, 3858.138, 9747.5

15, 5909.26, 7716.153

16, 3449.6, 4691.05

17, 4792.27, 5921.213

18, 5628.455, 7146.003

19, 14680.79, 20397.42

20, 9411.15, 9784.128

21, 3608.57, 6029.135

22, 5049.993, 7407.838

23, 20376.79, 26801.72

24, 7225.243, 12004.56

25, 21161.44, 30835.26

26, 3915.59, 4980.693

27, 6209.753, 7135.8

28, 6545.158, 7568.785

29, 9981.37, 12325.64

30, 6847.505, 10249.42

31, 3250.38, 3545.745

32, 13681.43, 17206.7

33, 2331.683, 4585.84

34, 3532.55, 4686.168

END DATA.

REGRESSION

  /MISSING LISTWISE

  /STATISTICS COEFF OUTS R ANOVA

  /CRITERIA=PIN(.05) POUT(.10)

  /NOORIGIN

  /DEPENDENT DV

  /METHOD=ENTER PV  .

IGRAPH /VIEWNAME='Scatterplot' /X1 = VAR(Metric) TYPE = CATEGORICAL /Y =

  VAR(DV) TYPE = SCALE /COORDINATE = VERTICAL  /FITLINE METHOD =

  REGRESSION LINEAR LINE = TOTAL SPIKE=OFF /X1LENGTH=3.0 /YLENGTH=3.0

 /X2LENGTH=3.0 /CHARTLOOK='NONE' /CATORDER VAR(Metric) (ASCENDING VALUES

  OMITEMPTY) /SCATTER COINCIDENT = NONE.

EXE.

.
Reply | Threaded
Open this post in threaded view
|

Re: Regression Plot

Beadle, ViAnn
the real problem here is that your syntax says that x is categorical and not scale so you even if you get the var right it wont do that line

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Friday, April 06, 2007 4:02 PM
To: Beadle, ViAnn; [hidden email]
Subject: RE: Regression Plot

Sorry about that. I guess it's time to call it a week. Thanks for your
help, ViAnn.

-----Original Message-----
From: Beadle, ViAnn [mailto:[hidden email]]
Sent: Friday, April 06, 2007 3:57 PM
To: Moffitt, James (West); [hidden email]
Subject: RE: Regression Plot

When I run this, (after removing all the blank lines) I get syntax error
pointing to an invalid variable name called metric on the IGRAPH
command.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Jim Moffitt
Sent: Friday, April 06, 2007 3:19 PM
To: [hidden email]
Subject: Regression Plot

I've provided some sample data and syntax for a simple regression below.
Why doesn't this syntax place a regression line on the scatter plot?
Thanks for your help.

DATA LIST LIST (",") / id PV DV.

BEGIN DATA

1, 14446.46, 16805.39

2, 6859.16, 8548.855

3, 9047.168, 13970.22

4, 6223.49, 4113.97

5, 4174.713, 5240.393

6, 12841.06, 19831.86

7, 3479.56, 6103.02

8, 4420.92, 7311.133

9, 4045.598, 5653.97

10, 7870.713, 10863.16

11, 7780.168, 9685.883

12, 4764.9, 5674.218

13, 9021.653, 17196.6

14, 3858.138, 9747.5

15, 5909.26, 7716.153

16, 3449.6, 4691.05

17, 4792.27, 5921.213

18, 5628.455, 7146.003

19, 14680.79, 20397.42

20, 9411.15, 9784.128

21, 3608.57, 6029.135

22, 5049.993, 7407.838

23, 20376.79, 26801.72

24, 7225.243, 12004.56

25, 21161.44, 30835.26

26, 3915.59, 4980.693

27, 6209.753, 7135.8

28, 6545.158, 7568.785

29, 9981.37, 12325.64

30, 6847.505, 10249.42

31, 3250.38, 3545.745

32, 13681.43, 17206.7

33, 2331.683, 4585.84

34, 3532.55, 4686.168

END DATA.

REGRESSION

  /MISSING LISTWISE

  /STATISTICS COEFF OUTS R ANOVA

  /CRITERIA=PIN(.05) POUT(.10)

  /NOORIGIN

  /DEPENDENT DV

  /METHOD=ENTER PV  .

IGRAPH /VIEWNAME='Scatterplot' /X1 = VAR(Metric) TYPE = CATEGORICAL /Y =

  VAR(DV) TYPE = SCALE /COORDINATE = VERTICAL  /FITLINE METHOD =

  REGRESSION LINEAR LINE = TOTAL SPIKE=OFF /X1LENGTH=3.0 /YLENGTH=3.0

 /X2LENGTH=3.0 /CHARTLOOK='NONE' /CATORDER VAR(Metric) (ASCENDING VALUES

  OMITEMPTY) /SCATTER COINCIDENT = NONE.

EXE.

.
Reply | Threaded
Open this post in threaded view
|

Re: Regression Plot

Jim Moffitt
Yep, I just caught that moments ago. I corrected that error and the
variable declaration and the syntax ran properly. Thank you.

-----Original Message-----
From: Beadle, ViAnn [mailto:[hidden email]]
Sent: Friday, April 06, 2007 4:08 PM
To: Moffitt, James (West); [hidden email]
Subject: RE: Regression Plot

the real problem here is that your syntax says that x is categorical and
not scale so you even if you get the var right it wont do that line

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Friday, April 06, 2007 4:02 PM
To: Beadle, ViAnn; [hidden email]
Subject: RE: Regression Plot

Sorry about that. I guess it's time to call it a week. Thanks for your
help, ViAnn.

-----Original Message-----
From: Beadle, ViAnn [mailto:[hidden email]]
Sent: Friday, April 06, 2007 3:57 PM
To: Moffitt, James (West); [hidden email]
Subject: RE: Regression Plot

When I run this, (after removing all the blank lines) I get syntax error
pointing to an invalid variable name called metric on the IGRAPH
command.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Jim Moffitt
Sent: Friday, April 06, 2007 3:19 PM
To: [hidden email]
Subject: Regression Plot

I've provided some sample data and syntax for a simple regression below.
Why doesn't this syntax place a regression line on the scatter plot?
Thanks for your help.

DATA LIST LIST (",") / id PV DV.

BEGIN DATA

1, 14446.46, 16805.39

2, 6859.16, 8548.855

3, 9047.168, 13970.22

4, 6223.49, 4113.97

5, 4174.713, 5240.393

6, 12841.06, 19831.86

7, 3479.56, 6103.02

8, 4420.92, 7311.133

9, 4045.598, 5653.97

10, 7870.713, 10863.16

11, 7780.168, 9685.883

12, 4764.9, 5674.218

13, 9021.653, 17196.6

14, 3858.138, 9747.5

15, 5909.26, 7716.153

16, 3449.6, 4691.05

17, 4792.27, 5921.213

18, 5628.455, 7146.003

19, 14680.79, 20397.42

20, 9411.15, 9784.128

21, 3608.57, 6029.135

22, 5049.993, 7407.838

23, 20376.79, 26801.72

24, 7225.243, 12004.56

25, 21161.44, 30835.26

26, 3915.59, 4980.693

27, 6209.753, 7135.8

28, 6545.158, 7568.785

29, 9981.37, 12325.64

30, 6847.505, 10249.42

31, 3250.38, 3545.745

32, 13681.43, 17206.7

33, 2331.683, 4585.84

34, 3532.55, 4686.168

END DATA.

REGRESSION

  /MISSING LISTWISE

  /STATISTICS COEFF OUTS R ANOVA

  /CRITERIA=PIN(.05) POUT(.10)

  /NOORIGIN

  /DEPENDENT DV

  /METHOD=ENTER PV  .

IGRAPH /VIEWNAME='Scatterplot' /X1 = VAR(Metric) TYPE = CATEGORICAL /Y =

  VAR(DV) TYPE = SCALE /COORDINATE = VERTICAL  /FITLINE METHOD =

  REGRESSION LINEAR LINE = TOTAL SPIKE=OFF /X1LENGTH=3.0 /YLENGTH=3.0

 /X2LENGTH=3.0 /CHARTLOOK='NONE' /CATORDER VAR(Metric) (ASCENDING VALUES

  OMITEMPTY) /SCATTER COINCIDENT = NONE.

EXE.

.