Discussion:
OUTPUT Command in SPSS
subhasree
2010-07-15 02:18:16 UTC
Permalink
Hi, Everyone,

I am new to PSPP and i am trying to write some code. I am familiar with
SPSS.

could anybody tell me what is the equivalent command in PSPP for OUTPUT
Command in SPSS.

Thanks & Regards
Subhasree
--
View this message in context: http://old.nabble.com/OUTPUT-Command-in-SPSS-tp29168606p29168606.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
Ben Pfaff
2010-07-15 02:58:40 UTC
Permalink
Post by subhasree
could anybody tell me what is the equivalent command in PSPP for OUTPUT
Command in SPSS.
SPSS has a number of commands whose names begin with OUTPUT:
OUTPUT ACTIVATE, OUTPUT CLOSE, OUTPUT DISPLAY, OUTPUT EXPORT,
OUTPUT NAME, OUTPUT OPEN, and OUTPUT SAVE.

What do you want to do?
--
Ben Pfaff
http://benpfaff.org
subhasree
2010-07-15 03:36:43 UTC
Permalink
Hi, Ben,

Thanks for the prompt reply.

I am looking an equivalent command in pspp for OUTPUT SAVE command in Spss.

Thanks & Regards
Subhasree
Post by Ben Pfaff
Post by subhasree
could anybody tell me what is the equivalent command in PSPP for OUTPUT
Command in SPSS.
OUTPUT ACTIVATE, OUTPUT CLOSE, OUTPUT DISPLAY, OUTPUT EXPORT,
OUTPUT NAME, OUTPUT OPEN, and OUTPUT SAVE.
What do you want to do?
--
Ben Pfaff
http://benpfaff.org
_______________________________________________
Pspp-users mailing list
http://lists.gnu.org/mailman/listinfo/pspp-users
--
View this message in context: http://old.nabble.com/OUTPUT-Command-in-SPSS-tp29168606p29168912.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
Ben Pfaff
2010-07-15 03:51:15 UTC
Permalink
Post by subhasree
I am looking an equivalent command in pspp for OUTPUT SAVE command in Spss.
There is no exact equivalent.

If you are using the GUI, you can export the contents of the
output viewer with File|Export.

If you are using the command-line version, you can use the -o and
-O options to configure output. The manual has details.
--
Ben Pfaff
http://benpfaff.org
subhasree
2010-07-15 05:52:00 UTC
Permalink
Thanks a lot Benn for the prompt answer.

Would like to know some more things which are equivalent in PSPP:

1. Dummy
2. DATASET DECLARE

Thanks in advance.

Regards
Subhasree
Post by Ben Pfaff
Post by subhasree
I am looking an equivalent command in pspp for OUTPUT SAVE command in Spss.
There is no exact equivalent.
If you are using the GUI, you can export the contents of the
output viewer with File|Export.
If you are using the command-line version, you can use the -o and
-O options to configure output. The manual has details.
--
Ben Pfaff
http://benpfaff.org
_______________________________________________
Pspp-users mailing list
http://lists.gnu.org/mailman/listinfo/pspp-users
--
View this message in context: http://old.nabble.com/OUTPUT-Command-in-SPSS-tp29168606p29169486.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
Ben Pfaff
2010-07-15 15:05:07 UTC
Permalink
Post by subhasree
1. Dummy
What is a Dummy in SPSS?
Post by subhasree
2. DATASET DECLARE
PSPP has the related concept of a "scratch file":
http://www.gnu.org/software/pspp/manual/html_node/File-Handles.html
--
Ben Pfaff
http://benpfaff.org
subhasree
2010-07-16 03:01:34 UTC
Permalink
Hi, Ben,

Thanks for the Reply.

i am trying to workout the following code in pspp

GET
FILE='C:\Data\MARKET.sav'.

COMPUTE DUMMY=1.
EXECUTE.
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
/BREAK=DUMMY
/RC_LP_mean=MEAN(RC_LAPSED_PERIOD)
/FV_mean=MEAN(FRE_VISIT)
/SS_mean=MEAN(SAL_SALES)
/BS_mean=MEAN(BAS_SALES).
DATASET DECLARE AGG_SSC7.
AGGREGATE
/OUTFILE='AGG_SSC7'
/BREAK=SSC7
/SS_mean=MEAN(SAL_SALES)
/SS_base=FIRST(SAL_SALES_mean)
/BS_mean=MEAN(BAS_SALES)
/BS_base=FIRST(BAS_SALES_mean)
/RC_LP_mean=MEAN(RC_LAPSED_PERIOD)
/RC_LP_base=FIRST(RC_LAPSED_PERIOD_mean)
/FV_mean=MEAN(FRE_VISIT)
/FV_base=FIRST(FRE_VISIT_mean)
/SS_sum=SUM(SAL_SALES)
/N_BREAK=N.

the error what i am getting are :

COMPUTE

COMPUTE DUMMY=1.

EXECUTE

EXECUTE.

AGGREGATE

AGGREGATE

/OUTFILE=* MODE=ADDVARIABLES

C:\Analytic Reporting\Syntax\Profiling_RFV.sps:14: error: AGGREGATE:
Syntax error expecting BREAK at `MODE'.

/BREAK=DUMMY

/RC_LP_mean=MEAN(RC_LAPSED_PERIOD)

/FV_mean=MEAN(FRE_VISIT)

/SS_mean=MEAN(SAL_SALES)

/BS_mean=MEAN(BAS_SALES).

DATASET

DATASET DECLARE AGG_SSC7.

C:\Analytic Reporting\Syntax\Profiling_RFV.sps:22: error: DATASET: DATASET
is not yet implemented.

AGGREGATE

AGGREGATE

/OUTFILE='AGG_SSC7'

/BREAK=SSC7

/SS_mean=MEAN(SAL_SALES)

/SS_base=FIRST(SAL_SALES_mean)

C:\Analytic Reporting\Syntax\Profiling_RFV.sps:27: error: AGGREGATE:
SAL_SALES_mean is not a variable name.

/BS_mean=MEAN(BAS_SALES)

/BS_base=FIRST(BAS_SALES_mean)

/RC_LP_mean=MEAN(RC_LAPSED_PERIOD)

/RC_LP_base=FIRST(RC_LAPSED_PERIOD_mean)

/FV_mean=MEAN(FRE_VISIT)

/FV_base=FIRST(FRE_VISIT_mean)

/SS_sum=SUM(SAL_SALES)

/N_BREAK=N.


Could you please help me in this.Tried using scratch file. But could not
succeed.

Thanks in advance

Regards
Subhasree
Post by Ben Pfaff
Post by subhasree
1. Dummy
What is a Dummy in SPSS?
Post by subhasree
2. DATASET DECLARE
http://www.gnu.org/software/pspp/manual/html_node/File-Handles.html
--
Ben Pfaff
http://benpfaff.org
_______________________________________________
Pspp-users mailing list
http://lists.gnu.org/mailman/listinfo/pspp-users
--
View this message in context: http://old.nabble.com/OUTPUT-Command-in-SPSS-tp29168606p29179640.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
Ben Pfaff
2010-07-16 04:07:42 UTC
Permalink
Post by subhasree
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
Syntax error expecting BREAK at `MODE'.
MODE=ADDVARIABLES isn't yet supported on AGGREGATE.
Post by subhasree
Could you please help me in this.Tried using scratch file. But could not
succeed.
How did you try using scratch files? The syntax you showed tries
to use DATASET commands, not scratch files.
--
Ben Pfaff
http://benpfaff.org
subhasree
2010-07-20 02:25:25 UTC
Permalink
Hi, Ben,

sorry for the late reply.

Here is the code


GET
FILE='C:\Analytic Reporting\Data\SAV_MARKET_200910_SAM_03_SSC.sav'.
COMPUTE DUMMY=1.
EXECUTE.


AGGREGATE
/OUTFILE = DUMMY
/BREAK=DUMMY
/RC_LAPSED_PERIOD_mean=MEAN(RC_LAPSED_PERIOD)
/FRE_VISIT_mean=MEAN(FRE_VISIT)
/SAL_SALES_mean=MEAN(SAL_SALES)
/BAS_SALES_mean=MEAN(BAS_SALES).

FILE HANDLE
/NAME = ' AGG_SSC7'
/MODE = SCRATCH
AGGREGATE
/OUTFILE='AGG_SSC7'
/BREAK=SSC7
/SAL_SALES_mean=MEAN(SAL_SALES)
/SAL_SALES_base=FIRST(SAL_SALES_mean)
/BAS_SALES_mean=MEAN(BAS_SALES)
/BAS_SALES_base=FIRST(BAS_SALES_mean)
/RC_LAPSED_PERIOD_mean=MEAN(RC_LAPSED_PERIOD)
/RC_LAPSED_PERIOD_base=FIRST(RC_LAPSED_PERIOD_mean)
/FRE_VISIT_mean=MEAN(FRE_VISIT)
/FRE_VISIT_base=FIRST(FRE_VISIT_mean)
/SAL_SALES_sum=SUM(SAL_SALES)
/N_BREAK=N.

The following is the error:

GET

GET

FILE='C:\Analytic Reporting\Data\SAV_MARKET_200910_SAM_03_SSC.sav'.

COMPUTE

COMPUTE DUMMY=1.

EXECUTE

EXECUTE.

AGGREGATE

AGGREGATE

/OUTFILE = DUMMY

/BREAK=DUMMY

/RC_LAPSED_PERIOD_mean=MEAN(RC_LAPSED_PERIOD)

/FRE_VISIT_mean=MEAN(FRE_VISIT)

/SAL_SALES_mean=MEAN(SAL_SALES)

/BAS_SALES_mean=MEAN(BAS_SALES).

FILE HANDLE

FILE HANDLE

/NAME = ' AGG_SSC7'

C:\Analytic Reporting\Syntax\Profiling_RFV.sps:17: error: FILE HANDLE:
Syntax error expecting identifier at `/'.

/MODE = SCRATCH

AGGREGATE

AGGREGATE

/OUTFILE='AGG_SSC7'

/BREAK=SSC7

/SAL_SALES_mean=MEAN(SAL_SALES)

/SAL_SALES_base=FIRST(SAL_SALES_mean)

C:\Analytic Reporting\Syntax\Profiling_RFV.sps:23: error: AGGREGATE:
SAL_SALES_mean is not a variable name.

/BAS_SALES_mean=MEAN(BAS_SALES)

/BAS_SALES_base=FIRST(BAS_SALES_mean)

/RC_LAPSED_PERIOD_mean=MEAN(RC_LAPSED_PERIOD)

/RC_LAPSED_PERIOD_base=FIRST(RC_LAPSED_PERIOD_mean)

/FRE_VISIT_mean=MEAN(FRE_VISIT)

/FRE_VISIT_base=FIRST(FRE_VISIT_mean)

/SAL_SALES_sum=SUM(SAL_SALES)

/N_BREAK=N.


could you please help. Thanks in advance.

Regards
Subhasree
Post by Ben Pfaff
Post by subhasree
AGGREGATE
/OUTFILE=* MODE=ADDVARIABLES
Syntax error expecting BREAK at `MODE'.
MODE=ADDVARIABLES isn't yet supported on AGGREGATE.
Post by subhasree
Could you please help me in this.Tried using scratch file. But could not
succeed.
How did you try using scratch files? The syntax you showed tries
to use DATASET commands, not scratch files.
--
Ben Pfaff
http://benpfaff.org
_______________________________________________
Pspp-users mailing list
http://lists.gnu.org/mailman/listinfo/pspp-users
--
View this message in context: http://old.nabble.com/OUTPUT-Command-in-SPSS-tp29168606p29210574.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.
Ben Pfaff
2010-07-20 03:03:36 UTC
Permalink
Post by subhasree
GET
FILE='C:\Analytic Reporting\Data\SAV_MARKET_200910_SAM_03_SSC.sav'.
COMPUTE DUMMY=1.
EXECUTE.
AGGREGATE
/OUTFILE = DUMMY
Do you mean /OUTFILE=#DUMMY? I am not certain what you are
trying to do here, so I'm not sure what to suggest.
Post by subhasree
/BREAK=DUMMY
/RC_LAPSED_PERIOD_mean=MEAN(RC_LAPSED_PERIOD)
/FRE_VISIT_mean=MEAN(FRE_VISIT)
/SAL_SALES_mean=MEAN(SAL_SALES)
/BAS_SALES_mean=MEAN(BAS_SALES).
FILE HANDLE
/NAME = ' AGG_SSC7'
/MODE = SCRATCH
You can omit this FILE HANDLE command.
Post by subhasree
AGGREGATE
/OUTFILE='AGG_SSC7'
Just write this as /OUTFILE=#AGG_SSC7.
Post by subhasree
/BREAK=SSC7
/SAL_SALES_mean=MEAN(SAL_SALES)
/SAL_SALES_base=FIRST(SAL_SALES_mean)
This use of FIRST on a variable created by AGGREGATE won't work.
(Does it work in SPSS?)
Post by subhasree
/BAS_SALES_mean=MEAN(BAS_SALES)
/BAS_SALES_base=FIRST(BAS_SALES_mean)
/RC_LAPSED_PERIOD_mean=MEAN(RC_LAPSED_PERIOD)
/RC_LAPSED_PERIOD_base=FIRST(RC_LAPSED_PERIOD_mean)
/FRE_VISIT_mean=MEAN(FRE_VISIT)
/FRE_VISIT_base=FIRST(FRE_VISIT_mean)
/SAL_SALES_sum=SUM(SAL_SALES)
/N_BREAK=N.
--
"...dans ce pays-ci il est bon de tuer de temps en temps un amiral
pour encourager les autres."
--Voltaire, _Candide_
Ben Pfaff
2010-07-20 03:42:43 UTC
Permalink
Yes in SPSS FIRST on a variable created by AGGREGATE will work. The FIRST
is something similar to the MIN function in oracle. Do we have something
similar in PSPP ?
Can you explain what taking the FIRST of a MEAN does, with an
example? I would expect that, within a break group, there is
only one mean, so the "first" over that mean is the same as the
mean. But I guess that cannot be the case or you would not
express it that way.
--
Ben Pfaff
http://benpfaff.org
Ben Pfaff
2010-07-21 20:07:54 UTC
Permalink
I still don't understand.

Here is the important part of the AGGREGATE command:
AGGREGATE
/BREAK=SSC7
/SAL_SALES_mean=MEAN(SAL_SALES)
/SAL_SALES_base=FIRST(SAL_SALES_mean)

Suppose that our input has the following rows:

SSC7 SAL_SALES
---- ---------
1 1000
1 1251
1 2000
2 900
2 950
2 1750
2 1800

The output would look like this:

SSC7 SAL_SALES_mean SAL_SALE_base
---- -------------- -------------
1 1417 ?
2 1350 ?

Can you fill in the ? entries for me?

Thanks,

Ben.
For example the
Sal_sales_mean = 4688,2456,3450
The base average which is first(sal_sales_mean) = 1000
-----Original Message-----
Sent: Tuesday, July 20, 2010 11:43 AM
To: CHOWDARY SUBHASREE KOSARAJU
Subject: Re: OUTPUT Command in SPSS
Yes in SPSS FIRST on a variable created by AGGREGATE will work. The FIRST
is something similar to the MIN function in oracle. Do we have something
similar in PSPP ?
Can you explain what taking the FIRST of a MEAN does, with an
example? I would expect that, within a break group, there is
only one mean, so the "first" over that mean is the same as the
mean. But I guess that cannot be the case or you would not
express it that way.
--
Ben Pfaff
http://benpfaff.org
Ben Pfaff
2010-07-22 16:52:26 UTC
Permalink
This is the description of the FIRST Command in SPSS
FIRST(varlist)- First nonmissing observed value in break group.
Is there something similar in PSPP for this?
I asked a question. You did not answer it. I cannot help you
without an answer.
--
Ben Pfaff
http://benpfaff.org
Loading...