Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: reading a value from a file into a scalar

To   <>
Subject   st: reading a value from a file into a scalar
From   "Chris Wallace" <>
Date   Thu, 06 Jun 2002 15:59:02 +0100

Dear statalisters,

I am using -ml- to maximize a multiple equation model.  One of the
steps in calculating the likelihood involves finding a particular
solution to a quartic.

I have written a function to do this in maple, and now want to use this
from within stata.  I am hoping to do this by calling maple from stata

. shell maple < maple_command_file

and writing the result from maple into a file, then reading that into
stata as I don't believe stata will accept a return value from shell. 
Can I assign the contents of a file (which I know will be a single
number) to a scalar?  How?

I'd rather not mess about with reading the single value using -infile-,
bc then I'd have to -preserve-/-restore- my rather large dataset each

I know I could also try using -bisect- from within Stata, but suspect
maple would be significantly faster if only I could get the 2 programs
to communicate nicely.  My worry with using maple is the errors that
might result from forcing stata and maple to read/write representations
of numbers to files.

Thanks for any suggestions, Chris.

*   For searches and help try:

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