Statalist


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

st: RE: SV: how do I overlay two linkplot graphs?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: SV: how do I overlay two linkplot graphs?
Date   Wed, 12 Dec 2007 14:56:13 -0000

Kim's suggestion won't work. -linkplot- cannot be used in this 
way, as it is only a stand-alone program and not also 
a -twoway- type. 

To answer the original question, and one of the doubts in 
Kim's reply, -linkplot- is a program from SSC. 

Only yesterday in a different thread I was saying,  

"Please remember the advice to specify where user-written 
commands you refer to may be located." 

That advice is spelled out in the FAQ, which all members 
are asked to read before posting. 

-linkplot- dates from 2003 and was written for version 8. 
One of its options is -plot()-. I will revise -linkplot-
to support also -addplot()- for users of Stata 9 or 10. 
-plot()- will still work in Stata 9 or 10, but is now undocumented. 

The criterion for -plot()- (or -addplot()-) is simple. Its argument 
must be capable of being fed to -twoway- as a -twoway- type. 
Stephen fed to -plot()- 

if task==1, linepattern(solid) if task==2, linepattern(dot)

but that isn't a self-contained -twoway- type call. Nor is it 
legal syntax for any other Stata purpose. Nor would something 
like 

. linkplot score character, link(GRP) if task ==1, 
	plot(linkplot score character if task==2)

work, for the reason given in my first sentence. 

I can't work out from Stephen's posting precisely what he wants. 
He refers to variables -character1-character5- but he 
is trying graph calls using -character-. Unless -character- 
is a separate variable there is no way that is going 
to work. 

I have to guess at this stage that Stephen is expecting from 
-linkplot- something that goes way beyond its specification. 
It should do what is claimed in its help, but no more. 

Further progress might depend on Stephen posting a sample 
dataset with precisely his kind of structure. What he wants
will be plottable, but not necessarily with -linkplot-. 

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

Kim Lyngby Mikkelsen
====================

Overlaying graphs is done using the '||'-option between plots you want
to overlay. 

Try something like this:

linkplot score character if task==1, link(GRP) linepattern(solid) ||
linkplot score character if task==2, link(GRP) linepattern(dot))

Obs: everything should be written within the same line!
Obs: I am not familiar with the linkplot command, and I do not know if
the part of your command after the comma is correct. I have removed your
specification of 'plot' as I can see that this option requires an
argument, which I think might be the name of another plot you have
previous saved.

Stephen Cox (edited) 
===========

For each case, I have 2 (task 1, task 2) sets of 5 variables (character1
- 5). 
I want to do a -linkplot- across the 5 character variables, one for each
task 
set, but overlayed, and with a different line patterns for each tasks.

I'm quite new to Stata, and can't work out how the -plot()- option
works. 
The help seems to say it allows -twoway connected- graph options, but I
keep 
getting error messages.

I can't define line patterns, nor get the two sets of lines to go on the
same 
graph. I am obviously not using the -plot()- options correctly here, but
can't work out how.

Here is one of the many many attempts I have had:

. linkplot score character, link(GRP) plot (if task==1,
linepattern(solid) if task==2, linepattern(dot))

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