Scatter with Real data

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
T_FIELD
Posts: 44
Joined: Sat May 15, 2010 8:03 pm

Scatter with Real data

Unread post by T_FIELD »

Is it possible to make a scatter plot of means of series among several countries?
What I want to do is like:

dec vec[real] ave_x(7)
dec vec[real] ave_y(7)

dofor [string] Country = "CANADA" "FRANCE" "GERMANY" "ITALY" "JAPAN" "UK" "USA"

set x = %s("x_"+Country)
set y = %s("y_"+Country)

sstats(mean) / x>>ave_x
sstats(mean) / y>>ave_y

end dofor

scatter
# ave_x ave_y

But, scatter is available only for series, isn't it?

Any assistances are welcome.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Scatter with Real data

Unread post by TomDoan »

This will do it

Code: Select all

clear(length=7) ave_x ave_y
dofor [string] Country = "CANADA" "FRANCE" "GERMANY" "ITALY" "JAPAN" "UK" "USA"
   sstats(mean) / %s("x_"+Country){0}>>ave_x(%doforpass) %s("y_"+Country){0}>>ave_y(%doforpass)
end dofor
scatter
# ave_x ave_y
T_FIELD
Posts: 44
Joined: Sat May 15, 2010 8:03 pm

Re: Scatter with Real data

Unread post by T_FIELD »

Dear Tom,

I can make it!
Thank you so much!
T_FIELD
Posts: 44
Joined: Sat May 15, 2010 8:03 pm

Re: Scatter with Real data

Unread post by T_FIELD »

Dear Tom,

I am confused again.
I want to make a scatter with X and Y.

dec vec X(100)
dec vec Y(100)

(For example)
do i = 1, 100
compute X = X +1
compute Y = 2Y +3
end do

scatter
# X Y

How can I transform X and Y into SERIES?
(Where should I read in manuals?)

Thanking in advance for your trouble.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Scatter with Real data

Unread post by TomDoan »

If you look under MAKE (which is for turning series into matrices), there's a description for the process of "unmaking" a matrix (or vector), that is, moving information from a vector or matrix into a series.

I'm not sure what you're trying to do (the little program snip that you posted won't work) but there IS a LINES option if you want to create straight lines.
T_FIELD
Posts: 44
Joined: Sat May 15, 2010 8:03 pm

Re: Scatter with Real data

Unread post by T_FIELD »

Dear Tom,

By reading Reference Manual on "unmake," I could make the scatter as I hope.
Thank you so much for your kind assistance!
Post Reply