On Sun, 22 Nov 2009, Remigijus Lapinskas wrote:
Artur and other good people from the list,
This is close to what I want. The only problem is that x takes 90
values, so I need a loop. I am close to solution, however I hasn't
caught it yet.
does this help?
<script>
set echo off
set messages off
nulldata 40
x = floor(uniform()*4)
y = normal()
print x y -o
v = values(x)
n = rows(v)
means = zeros(n,2)
loop for i=1..n --quiet
means[i,1] = v[i]
means[i,2] = mean((x=v[i]) ? y : NA)
end loop
print means
</script>
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti