Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: A simple program with a weird behavior


From   [email protected]
To   [email protected]
Subject   st: A simple program with a weird behavior
Date   Mon, 7 Jul 2008 12:21:49 -0300 (BRT)

Thank you very much to Ulrich, Philippe and Eva for their highly helpful
tips/comments on my problem!

Cheers!

Tiago

------------------------------------------------------------------

Dear Statalisters,

It is not rare for me to write Stata programs and face problems like the
one just mentioned below. I will be very grateful for any expert opinion.
Thank you so much for your time.

All the best,


Tiago

*/------------------------------start--------------------------------

capture program drop example
*! example v1. TVP 2008
program define example, rclass byable(recall) sortpreserve
version 9.0
syntax [varlist], LOCI(integer) MEANS(real) SDS(real) ORS(string) K(real)
MODEL(string) pa(string) INCREMENT(real)


	scalar n_x = 100000
	scalar PREV = "`k'"
	scalar affected =  PREV*n_x



end

*/------------------------------end--------------------------------


. example, means(100) sds(1) ors(1.2,1.3,1.5) loci(4) k(0.3)
model(genetic_stuff) pa(0.4) increment(0.000001)
type mismatch
r(109);

If I delete the last line:

scalar affected =  PREV*n_x

the program works fine.





*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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