Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Mkmat doesn't seem to store the observation values correctly?
From
"Tim Streibel" <[email protected]>
To
[email protected]
Subject
Re: st: Mkmat doesn't seem to store the observation values correctly?
Date
Sun, 21 Oct 2012 12:31:38 +0200
You're right, when I input the values as you did, it perfectly works. My variable name was correct, could it be a problem that I imported the data from Excel?
Thanks a lot!
-------- Original-Nachricht --------
> Datum: Sun, 21 Oct 2012 11:15:49 +0100
> Von: Nick Cox <[email protected]>
> An: [email protected]
> Betreff: Re: st: Mkmat doesn\'t seem to store the observation values correctly?
> I don't know why you thought that. I can't reproduce your problem.
> Check your variable names carefully.
>
> . input Ticker
>
> Ticker
> 1. 441235
> 2. 463
> 3. 13212
> 4. 1213
> 5. 321
> 6. 212
> 7. 346
> 8. 1322
> 9. 3434
> 10. end
>
> . l
>
> +--------+
> | Ticker |
> |--------|
> 1. | 441235 |
> 2. | 463 |
> 3. | 13212 |
> 4. | 1213 |
> 5. | 321 |
> |--------|
> 6. | 212 |
> 7. | 346 |
> 8. | 1322 |
> 9. | 3434 |
> +--------+
>
> . mkmat Ticker, matrix(X)
>
> . mat li X
>
> X[9,1]
> Ticker
> r1 441235
> r2 463
> r3 13212
> r4 1213
> r5 321
> r6 212
> r7 346
> r8 1322
> r9 3434
>
>
> On Sun, Oct 21, 2012 at 11:05 AM, Tim Streibel <[email protected]>
> wrote:
> > Sorry, I thought it would be clear that the values are just different
> >
> > list Ticker
> >
> > +--------+
> > | Ticker |
> > |--------|
> > 1. | 441235 |
> > 2. | 463 |
> > 3. | 13212 |
> > 4. | 1213 |
> > 5. | 321 |
> > |--------|
> > 6. | 212 |
> > 7. | 346 |
> > 8. | 1322 |
> > 9. | 3434 |
> >
> > variable type: long
> >
> > Do you need any other information?
> >
> > -------- Original-Nachricht --------
> >> Datum: Sun, 21 Oct 2012 10:50:22 +0100
> >> Von: Nick Cox <[email protected]>
> >> An: [email protected]
> >> Betreff: Re: st: Mkmat doesn\'t seem to store the observation values
> correctly?
> >
> >> You don't show us your original variable, so we can't see any grounds
> >> for your claim.
> >>
> >> Nick
> >>
> >> On Sun, Oct 21, 2012 at 9:44 AM, Tim Streibel <[email protected]>
> wrote:
> >> > First of all, I am sure that mkmat stores the values correctly, but I
> >> dont know in which way it stores them.
> >> >
> >> > All I want to do is creating a matrix from a variable of my dataset
> >> (even only 1xT format). However if I use mkmat, matrix list does not
> yield the
> >> original values of my variable (as you can see below). Since I would
> like
> >> to do some calculations with the created matrix, I would like to check
> >> whether the matrix contains the correct values.
> >> >
> >> >
> >> > mkmat Ticker, matrix(X)
> >> >
> >> > . matrix list X
> >> >
> >> > X[9,1]
> >> > Ticker
> >> > r1 8
> >> > r2 9
> >> > r3 2
> >> > r4 1
> >> > r5 5
> >> > r6 4
> >> > r7 7
> >> > r8 3
> >> > r9 6
> >>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/