title: Plotting 3D function and points in SPSS
body: <p>I want to plot a 3D graph with points (I think I have managed that) and also fitting a mathematical function of set of that points. My variable V1 can assume two values 2 or 4. So, If V1 is equal to 2 a function is plotting, else if V1 is equal to 4 other function is plotting. When I try do it this message appear:</p>
  
  <p><strong>Erro de GPL: algebra(iter(5000,1000000,10)DOIF(V1=2).)
  Expecting ( or + or * or /: iter(5000,1000000,10)DOIF(V1=2)</strong></p>
  
  <p>My code:</p>
  
  <pre><code>&gt; GGRAPH    /GRAPHDATASET NAME="graphdataset" VARIABLES=V2 pacpop V1
  &gt; MISSING=LISTWISE REPORTMISSING=NO    /GRAPHSPEC SOURCE=INLINE.  BEGIN
  &gt; GPL    SOURCE: s=userSource(id("graphdataset"))    
  &gt;DATA:V2=col(source(s), name("V2"))    
  &gt;DATA: pacpop=col(source(s),name("pacpop"))    
  &gt;DATA: V1=col(source(s), name("V1"),unit.category())    
  &gt;COORD: rect(dim(1,2,3))    
  &gt;GUIDE: axis(dim(1),label("Sexo"))   
  &gt; GUIDE: axis(dim(2), label("Rendimento Mensal"))   
  &gt; GUIDE: axis(dim(3), label("pacpop"))    
  &gt;SCALE: log(dim(2), base(10))  
  &gt;SCALE: log(dim(3), base(10))  
  &gt;SCALE: cat(dim(1), include("2", "4")) 
  &gt; ELEMENT: point(position(V1*V2*pacpop))  
  &gt;DATA: p = iter(0,5000,1)  
  &gt; DATA: q = iter(5000,1000000,10)   
  &gt;DATA: x = iter(0,5000,1)   
  &gt;DATA: z =iter(5000,1000000,10)  
  &gt;DO IF (V1=2). 
  &gt;TRANS: y =eval(100*exp((-x/1654.97)) 
  &gt; TRANS: w = eval((10**8.865)/(z**2.186)) 
  &gt; ELEMENT: line(position(V1*x*y),color.interior(color."ff0000")) 
  &gt; ELEMENT: line(position(V1*z*w), color.interior(color."ff0000")) 
  &gt; ELSE.
  &gt; TRANS: r = eval(100*exp((-p/1415.97))  
  &gt;TRANS: s = eval((10**7.065)/(q**2.216))  
  &gt;ELEMENT:line(position(V1*p*r),color.interior(color."ff0000"))  
  ELEMENT:line(position(V1*q*s), color.interior(color."ff0000")) 
  &gt;END IF.
  &gt; END GPL.
  </code></pre>