ALL 0.000

Hello,

I have some mortality data, da(a,t), of age group a in year t. For an olg model I want to convert this data to similar data based on kohort, identified by the year of birth, so that the age, a = t-k.
In maths notation I then want to define a perameter:
d(k,t) = da(t-k,t),
but as we cannot subtrackt elements of sets, this clearly isn’t possible.

My attempt, the whole gams file is attached:
SETS
k kohort /19202200/
t time /1943
2200/
a age /23*95/
Alias (t, tp)
Alias (k, kp);

*IMPOTERING FROM EXCEL
TABLE d(a,t)
$call =xls2gms R=A1:IY74 “kvinner_u.xlsx” o=v.inc
$include v.inc

PARAMETER
de(k,t) dead in a kohort k at time t;
de(k,t) = sum(a, d(a,t)$(ord(t)-ord(k))=ord(a));

Display de;


This does not work and I get:

E x e c u t i o n

---- 105 PARAMETER de dead in a kohort k at time t
( ALL 0.000 )


Does anyone know a way to do this?

Yours,
Ragnhild Dalsbø


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

SETS
i index of time /19202200/
k(i) kohort /1920
220/
t(i) time /1943220/
a age /23
95/
map(k,t,a)
Alias (t, tp)
Alias (k, kp);

map(k,t,a) = yes$(ord(k)=ord(t)-ord(a));
parameter
d(a,i)
de(k,t)
;
loop(t,
d(a,t) = ceil(uniform(0,100));
);

de(k,t) = sum(a$map(k,t,a), d(a,t));

display map,d,de;


Den tisdagen den 6:e maj 2014 kl. 20:43:52 UTC+2 skrev Ragnhild Dalsbø:

Hello,

I have some mortality data, da(a,t), of age group a in year t. For an olg model I want to convert this data to similar data based on kohort, identified by the year of birth, so that the age, a = t-k.
In maths notation I then want to define a perameter:
d(k,t) = da(t-k,t),
but as we cannot subtrackt elements of sets, this clearly isn’t possible.

My attempt, the whole gams file is attached:
SETS
k kohort /19202200/
t time /1943
2200/
a age /23*95/
Alias (t, tp)
Alias (k, kp);

*IMPOTERING FROM EXCEL
TABLE d(a,t)
$call =xls2gms R=A1:IY74 “kvinner_u.xlsx” o=v.inc
$include v.inc

PARAMETER
de(k,t) dead in a kohort k at time t;
de(k,t) = sum(a, d(a,t)$(ord(t)-ord(k))=ord(a));

Display de;


This does not work and I get:

E x e c u t i o n

---- 105 PARAMETER de dead in a kohort k at time t
( ALL 0.000 )


Does anyone know a way to do this?

Yours,
Ragnhild Dalsbø


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Hi Ragnhild

Without the table, it is hard to check your code.

Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Ragnhild Dalsbø
Sent: Tuesday, May 6, 2014 8:44 PM
To: gamsworld@googlegroups.com
Subject: ALL 0.000



Hello,

I have some mortality data, da(a,t), of age group a in year t. For an olg model I want to convert this data to similar data based on kohort, identified by the year of birth, so that the age, a = t-k.

In maths notation I then want to define a perameter:
d(k,t) = da(t-k,t),
but as we cannot subtrackt elements of sets, this clearly isn’t possible.

My attempt, the whole gams file is attached:

SETS
k kohort /19202200/
t time /1943
2200/
a age /23*95/

Alias (t, tp)
Alias (k, kp);



*IMPOTERING FROM EXCEL
TABLE d(a,t)
$call =xls2gms R=A1:IY74 “kvinner_u.xlsx” o=v.inc
include v.inc \ \ \ PARAMETER de(k,t) dead in a kohort k at time t; de(k,t) = sum(a, d(a,t)(ord(t)-ord(k))=ord(a));



Display de;




This does not work and I get:



E x e c u t i o n


---- 105 PARAMETER de dead in a kohort k at time t

( ALL 0.000 )




Does anyone know a way to do this?


Yours,
Ragnhild Dalsbø


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.