Statalist


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

st: Updating user-supplied code / mca example


From   "Allan Reese (Cefas)" <allan.reese@cefas.co.uk>
To   "'Statalist (E-mail)" <statalist@hsphsun2.harvard.edu>
Subject   st: Updating user-supplied code / mca example
Date   Tue, 7 Oct 2008 10:45:41 +0100

I found out recently that I've been misunderstanding the version command.  It's used in ADO files "to ensure your do-file will continue to work with different versions of Stata", and undoes changes to commands made in later versions.  But it doesn't prevent the use of commands added in later versions.

The example to hand is that I'm using mca.ado: 
*! version 1.3.1 Philippe VAN KERM, February 1998  STB-42 sg78 
and wanted to update the graph plotting.  It was possible simply to change the graph command to "twoway scatter" leaving the program to run as "version 5".

Philippe's code:
			while `n2'<=`d' {
                               graph FDim`n2' FDim`n1', s([Flab]) /*
                                  */ b1("Multiple Correspondence Analysis") /*
                                  */ b2("Axis `n1'") l1(" ") /*
                                  */ l2("Axis `n2'") xla yla xline(0) /*
                                  */ yline(0)  border 
				loc n2 = `n2' + 1

becomes:
			while `n2'<=`d' {
                                twoway scatter FDim`n2' FDim`n1', msym(i) mlab(Flab) mlabpos(c) /*
                                  */ b1("Multiple Correspondence Analysis") /*
                                  */ xti("Axis `n1'") yti("Axis `n2'") /*
                                  */ xline(0) yline(0) `scatopt' 
				loc n2 = `n2' + 1 

The new option scatopt is a string to allow any other twoway options to be passed through the command.  It is declared at the start of the program:

Philippe:
loc options "d(integer 0) q(real 0) Notrans"
parse "`*'"

becomes:
* Option scatopt added Sept 2008. RAR.
loc options "d(integer 0) q(real 0) Notrans scatopt(string)"
parse "`*'"

Incidentally, are there any other mca users, and any further developments of the code?
Allan

R Allan Reese
Senior statistician, Cefas
The Nothe, Weymouth DT4 8UB 

Tel: +44 (0)1305 206614
Fax: +44 (0)1305 206601  

www.cefas.co.uk 

 

 


***********************************************************************************
This email and any attachments are intended for the named recipient only.  Its unauthorised use, distribution, disclosure, storage or copying is not permitted.  If you have received it in error, please destroy all copies and notify the sender.  In messages of a non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect those of the organisation from which it is sent.  All emails may be subject to monitoring.
***********************************************************************************


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