Page 1 of 1
Scatter with Real data
Posted: Wed Nov 22, 2017 8:27 pm
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.
Re: Scatter with Real data
Posted: Wed Nov 22, 2017 10:02 pm
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
Re: Scatter with Real data
Posted: Fri Nov 24, 2017 12:37 am
by T_FIELD
Dear Tom,
I can make it!
Thank you so much!
Re: Scatter with Real data
Posted: Tue Dec 26, 2017 4:39 am
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.
Re: Scatter with Real data
Posted: Tue Dec 26, 2017 7:52 am
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.
Re: Scatter with Real data
Posted: Tue Dec 26, 2017 9:41 am
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!