Statalist


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

st: RE: RE: SV: how do I overlay two linkplot graphs?: now trying -xtline-


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: SV: how do I overlay two linkplot graphs?: now trying -xtline-
Date   Thu, 13 Dec 2007 14:33:45 -0000

This is a lot clearer. In addition to direct attacks using -twoway- 
explicitly, 

separate Score, by(Task) 

then 

linkplot Score? Character, link(GRP) 

but that would be a mess.  

To get a slide show, assuming prior use of -separate- as above, 

forval i = 1/203 { 
	linkplot Score? Character if GRP == `i', link(GRP) asyvars
///	subtitle(GRP `i') 
	more 
}

Nick 
[email protected] 

Stephen Cox

Hmmm, sorry for my confusing first attempt. After I sent it I realised I
had not said I had changed my data to long form.

Here is my data format:

GRP Task Character Score
1       1       1       40
1       1       2       44
1       1       3       11
1       1       4       78
1       1       5       38
1       2       1       42
1       2       2       46
1       2       3       17
1       2       4       71
1       2       5       42
2       1       1       40
2       1       2       44
2       1       3       11
2       1       4       78
2       1       5       38
2       2       1       42
2       2       2       46
2       2       3       17
2       2       4       71
2       2       5       42
Etc

For each GRP (group), I am wanting to get two line graphs for Score
against Character, one graph for each Task. And I want all graphs
overlayed.


Lets assume I have only the values for Task = 1.

After defining the dat set to be a panel data using

 . tsset GRP character

Then using the following command:

.xtline score, overlay legend (off)

I can get a graph for Task = 1 in the form I want.


But I want to have another graph for Task=2, and have those graphs
overlayed.

I am unsure how to do this with -xtline-, as I think I would need two
'score' variables, one for each Task, but then I can't use the overlay
option.

I am not sure how to do this with -linkplot- (from SSC) either.

And ultimately I will have to do it all for some different subsets of
cases as I have 203 GRPs which will be too many too see on one graph,
but that is another learning task for me.


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