Does anyone know an easy way to square a variable in spss 19, that is,
to create a new variable by multiplying the values of a variable by
itself?
Thanks!!
COMPUTE is the SPSS keyword,
COMPUTE new= old*old.
See your SPSS on-disk documentation to get started.
For some wider issues, UCLA has a very helpful website.
--
Rich Ulrich
compute x_squared = x**2 .
compute x_cubed = x**3 .
compute sqrt_x = x**0.5 .
compute cuberoot_x = x**(1/3) .
HTH.
--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/Home
"When all else fails, RTFM."
I take that it isn't as simple as - compute test=var1**2?
I replied a few hours ago (via the NEW Google Groups interface), but
still have not seen that response. So here goes again, this time from
the OLD Google Groups interface. Apologies if it ends up appearing
twice.
compute vsq=v*v.
or
compute vsq=v**2.
jon
You may use the arithmetic operator:
** Exponentiation
Something like this:
COMPUTE New_VAR=VAR**2.
Your variable is "VAR" and the operator is creating a new variable
"New_VAR".
KI
I'd guess it "ain't' different than prior versions - compute
Test=var1**2.