[R] dummy variable
gunter.berton at gene.com
Sun Jul 22 16:04:49 CEST 2012
Are you sure?? I am wholly unfamiliar with garch, but in general, R
does not need dummy variables at all. You make your covariate a factor
with appropriate contrasts and then write an appropriate model
formula, in this case, with an interaction with your series.
I could be wrong in this case, but do check. Perhaps someone with
garch model experience will comment.
On Sun, Jul 22, 2012 at 5:45 AM, Rui Barradas <ruipbarradas at sapo.pt> wrote:
> See if this is it.
> returns <- rnorm(10)
> dummy <- ifelse(returns < 0, -1, 0)
> Hope this helps
> Rui Barradas
> Em 22-07-2012 08:53, saraberta escreveu:
>> i need a little help! i must create a dummy variable to insert as external
>> regressor in the variance equation of a garch model; this dummy is
>> to the negative sign of returns of an asset, so it has to be 1 when
>> are negative and 0 when they are positive, and in my model the dummy is
>> multiplied by another time series, the daily range. (have i explained
>> thank's a lot
>> View this message in context:
>> Sent from the R help mailing list archive at Nabble.com.
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Genentech Nonclinical Biostatistics
Internal Contact Info:
More information about the R-help