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

st: RE: Plotting observed and predicted values on same scatterplot matrix


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Plotting observed and predicted values on same scatterplot matrix
Date   Wed, 24 Jul 2002 10:43:15 +0100

Dale Steele

>     I have been struggling to "overlie" two sets of data on the same
> scatterplot matrix.  I have two stata data files.  The
> first contains the
> raw data from an experiment.  The second file contains
> calculated predicted
> values which I would like to plot as a line on top of the
> observed values in
> the first file.
>
>    Various permutations of the -merge- command have failed
> to merge the two files.
>
> I've made plots of each using:
> graph response resistnc, by(idnum) total jitter(2)
> ylabel(0, 2 to 10)
>   and
> graph R resistnc, by(idnum) connect(l) ylabel(0, 2 to 10) total
>
>  Suggestions?
>
> Details follow..
>
>   Each subject given 6 stimuli, response to each stimulus
> measured five
> times.  Thus the file looks like:
>
> list idnum resistnc response
>
>          idnum   resistnc   response
>   1.       401          0          0
>   2.       401          0          0
>   3.       401          0          0
>   4.       401          0         .7
>   5.       401          0          0
>   6.       401        2.5        1.9
>   7.       401        2.5        1.5
>   ...
>
> The second file contains a predicted response (R) based on
> a predicted curve
> for each subject.
>
> . list idnum resistnc R
>
>          idnum   resistnc          R
>   1.       401          0        .14
>   2.       401        2.5   2.489528
>   3.       401          5   3.538459
>   4.       401         10   5.055678
>   5.       401         20    7.25025
>   6.       401         30   8.963791
>   7.       402          0         .4
>   8.       402        2.5   1.289712
>   9.       402          5   2.060106
>  10.       402         10   3.497576
>  11.       402         20   6.179739
>

Note that Dale wants a matrix of scatterplots, but not one in
the sense of -graph, matrix-. The files having been merged,
this would seem to be something like

. sort idnum
. graph response R resistnc, by(idnum) total jitter(2)
ylabel(0(2)10) c(.l) sy(oi)

The key question thus appears to be what Dale tried with -merge-
and why it didn't work. The only clue given here is that
-resistnc- appears in different form for -idnum- 401.

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

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