Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

deleting column with spss syntax.

657 views
Skip to first unread message

li...@post.tau.ac.il

unread,
Dec 17, 2002, 12:20:30 PM12/17/02
to
i want to run a program with temp variables and i want the program to delete
those colums automaticly and not by hand. Doe's anyone know how do i do
that?
Thank,
Lior


Michael Lacy

unread,
Dec 17, 2002, 1:43:21 PM12/17/02
to


match files file = * /drop = temp1 temp2 .

will drop variables temp1 and temp2 .

Regards,

--
=-=-=-=-=-=-=-=-=-==-=-=-=
Mike Lacy, Ft Collins CO 80523
voice (970) 491-6721

Raynald Levesque

unread,
Dec 17, 2002, 3:18:29 PM12/17/02
to

the following line deletes variables a,b and c.

ADD FILES FILE=* /DROP=a b c.

HTH

Raynald Levesque rlev...@videotron.ca
Visit My SPSS Pages: http://pages.infinit.net/rlevesqu/index.htm

jim clark

unread,
Dec 17, 2002, 3:16:47 PM12/17/02
to
Hi

Another way to do this is to use the #varname
convention. Variables beginning with # are treated as temporary
by SPSS. Run the following program to see this.

data list free / x
begin data
1 2 3 4 5
end data
comp #new = x*2
comp x2 = #new
list


Best wishes
Jim

============================================================================
James M. Clark (204) 786-9757
Department of Psychology (204) 774-4134 Fax
University of Winnipeg 4L05D
Winnipeg, Manitoba R3B 2E9 cl...@uwinnipeg.ca
CANADA http://www.uwinnipeg.ca/~clark
============================================================================

Neila Nessa

unread,
Dec 18, 2002, 12:30:46 PM12/18/02
to
As Jim indicates, scratch variables are an appropriate solution.

*BUT VERY IMPORTANT!!!!*
Be careful though as they are initialized to 0 (rather than sysmis),
and
not reinitialized when reading the next case. They are also discarded
after any proceedure (including EXECUTE commands , TEMPORARY etc... )

Note that since they are NOT reinitialized they can nicely work as an
alternative to a LAG function -or LEAVE command-
( assuming you don't need them for procedures, weighting or retention
in the file) . If you require them for analysis then you will need to
set the value of some permanent variable to the value of the scratch
variable. In that case use a MATCH or ADD FILES command to drop the
unwanted variables as Reynald suggested - BUT, be careful as I believe
the active file is then nameless (at least that used to be the case,
perhaps different in newer versions).

See the Syntax Reference guide for the full blown down and dirty.
*BE CAREFUL TO TEST ANY SYNTAX AND INSPECT RESULTS VERY CAREFULLY
for side effects as scratch variables behave quite differently than
normal variables* !!!).

HTH, Neila

jim clark <cl...@uwinnipeg.ca> wrote in message news:<Pine.GSO.4.21.021217...@io.uwinnipeg.ca>...

0 new messages