Em 16 de dezembro Henrique Andrade <henrique.coelho(a)gmail.com> escreveu:
Em 16 de dezembro de 2010 Laurent Schuermans <laurent.schuermans(a)gmail.com>:
Dear all,
>
> In econometric classen, we use gretl along with the Principles of
> Econometrics handbook. Now we have to write a paper and do research about a
> subject of own interest while using gretl.
>
> The problem however is that I don't know how to recode variables in gretl.
> I have a bunch of dichotomious variables with categories 1 and 2 that I want
> to recode to 0 and 1, which is easier for interpretation, but I don't know
> how to do this.
>
> Can somebody help me out?
>
Dear Laurent, suppose you have two series, "variable1", with the values
"2", and "variable2", with values "1". I think you could
try this:
*<script>*
*series* variable1 = variable1 - 1
*series* variable2 = variable2 - 1
*</script>*
I'd made a mistake :-( Let me try to correct it. Supose you have a variable
that assumes only 2 and 1 as values. So now you can try this:
*<script>*
*series* variable = variable - 1
***</script>*
In that you way all your 2 will become 1 (because 2-1=1) and all your 1 will
become 0 (because 1-1=0). You can try my suggestion, but the Ignacio's
suggestion is much more elegant ;-)
Best regards,
--
Henrique C. de Andrade
Doutorando em Economia Aplicada
Universidade Federal do Rio Grande do Sul
www.ufrgs.br/ppge