Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Help with mathematical operation


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: Help with mathematical operation
Date   Thu, 10 Sep 2009 13:59:19 -0400

Like this?

clear
set obs 12
g x=_n
tempfile t
save `t'
ren x y
cross using `t'
g xy=x*y


On Thu, Sep 10, 2009 at 1:18 PM, Burnett,
Tim<[email protected]> wrote:
> Hello,
>
> I am at the end of my tether with Stata 10 and was hoping someone could help me:
>
> I have a dataset which I am trying to manipulate:
>
> Assuming the following variable:
>
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
>
> I am trying to create a variable which will show:
>
> 1*1
> 1*2
> 1*3
> 1*4
> .
> .
> .
> 2*1
> 2*2
> 2*3
> 2*4
> .
> .
> .
> ...and so on.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index