I have two scale variables (range 0-10) that I have plotted against eachother in a regular scatterplot. I would like to add a single point at the mean value of each variable (x value mean Var1, y value mean Var2) in a different color but I can't seem to get the syntax right.

My current syntax is

GGRAPH

/GRAPHDATASET NAME="graphdataset" VARIABLES=Var1 Var2

Gender MISSING=LISTWISE REPORTMISSING=NO

/GRAPHSPEC SOURCE=INLINE

/FITLINE TOTAL=NO SUBGROUP=NO.

BEGIN GPL

SOURCE: s=userSource(id("graphdataset"))

DATA: Var1=col(source(s), name("Var1"))

DATA: Var2=col(source(s), name("Var2"))

DATA: Gender=col(source(s), name("Gender"), unit.category())

GUIDE: axis(dim(1), label("Var1"))

GUIDE: axis(dim(2), label("Var2"))

GUIDE: legend(aesthetic(aesthetic.color.interior), label("First interface (p/m)"))

GUIDE: text.title(label("Grouped Scatter of Var2 by Var1 by First ",

"interface (p/m)"))

ELEMENT: point(position(Var1*Var2), color.interior(Gender))

END GPL.

I have looked at this command but it doesn't give me the desired result.

ELEMENT: point.dodge.symmetric(position(summary.mean(Var1*Var2)), color(color.green))

The easiest solution would be to calculate the coordinates ahead (2.17, 3.07) and then just add a point based on these values. What is the syntax to add a single point in a current scatterplot? I have tried but not suceeded.

I am grateful for any help since I have really tried to find the answer but yet not suceeded.

More Markus Falk's questions See All
Similar questions and discussions