Statalist


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

st: Re: AW: Type mismatch in while and somes issues with statalist


From   "Mike Kim" <[email protected]>
To   <[email protected]>
Subject   st: Re: AW: Type mismatch in while and somes issues with statalist
Date   Thu, 7 May 2009 20:54:04 -0500

<>

Sorry, I meant i=1/5 with a few similar steps to complete the process. 
'forv' worked well as you and Tirthankar recommended. Thank you.

Thank you for your advice on how to post on statalist, too. I think HTML 
setting was the problem.

Reo.


----- Original Message ----- 
From: "Martin Weiss" <[email protected]>
To: <[email protected]>
Sent: Thursday, May 07, 2009 5:18 PM
Subject: st: AW: Type mismatch in while and somes issues with statalist


<>

BTW, the type mismatch problem comes from the fact that you are trying to
condition on - if v`i'==""- although your v? variables are numeric and the
code should consequently read - if v`i'==. - .

Even then, the rationale for the -while- loop remains hazy to me. You set
"i" to 4 and then step it up to 5 inside the loop, so the whole thing runs
two times. Then you could simply code

*************
forv i=4/5{

}
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Kalisperos
Gesendet: Donnerstag, 7. Mai 2009 23:10
An: [email protected]
Betreff: st: Type mismatch in while and somes issues with statalist

Hello all,

I have three questions.  First, my data structure is like this:

v1  v2  v3......
1    .    .
.    2    .
.    .    3
........

To stack all observations in v1, I tried the following code, but Stata
returns "type mismatch." How can I do this work?

local i=4
while `i'<5 {
replace v`i'=v`i'+1 if v`i'==""
local i=`i'+1
}


Second, If I send an email to statalist.by starting a new email, my mail is
not posted. If I reply to an existing one, the mail goes through. I know
this is not recommended. How can I post a new thread? Why can I not start a
thread? I removed my account and resubscribed, but it did not work either.


Third, I am receiving two same emails for every posting. Again, I removed my

account and re-subscribed, but I am still getting two same emails of every
posting. How can I fix this problem?


Thank you for your help in advance.
Mike.

*
*   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/


*
*   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/ 

*
*   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