Statalist


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

RE: st: Hiding contents of a do-file


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Hiding contents of a do-file
Date   Mon, 1 Feb 2010 13:04:08 -0000

I can't see your Mata function -one()- but it is likely to need an
argument (something to feed on). You don't supply one. 

More generally, commenting on code errors is difficult without seeing
the precise code or the precise error. 

Why don't you just not send your users the do file? Are you writing a do
file that users are expected to use their end but you don't want them to
know what is inside? 

Nick 
n.j.cox@durham.ac.uk 

Rasika Raghavan

This is part of the code which I need to encrypt. I need to encrypt
the replace command in the forvalues loop.

use temp1, clear
merge using temp2
drop _merge
gen score=.
forvalues i=6(1)19 {
replace score = rss*coeff_rss_`i'[1] + db_tb*coeff_db_tb_`i'[1] +
remw*coeff_remw_`i'[1] + maxp*coeff_maxp_`i'[1] +
d_fifty*coeff_d_fifty_`i'[1] if overno==`i'
}
save model, replace

I encrypted the "replace score=..." command and save it as one.mo as
mentioned in the thread.

If I run the do-file now as:
use temp1, clear
merge using temp2
drop _merge
gen score=.
forvalues i=6(1)19 {
mata:one()
}
save model, replace

it is showing an error. I am not much familiar with Mata, so is there
a way around this?

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index