Adding Categorical variable as a predictor variable in CausalImpact analysis

197 views
Skip to first unread message

nitika gupta

unread,
Jan 8, 2015, 5:08:48 AM1/8/15
to causal...@googlegroups.com
 
Want to add categorical variable as one of the predictor variable . If it's possible , kindly tell me how?
 
This variable is crucial for analysis
 
 
Thanks,
Nitika

Kay Brodersen

unread,
Jan 8, 2015, 6:43:21 AM1/8/15
to nitika gupta, causal...@googlegroups.com
Hi Nitika,

I'd begin by turning the categorical variable into a set of 0/1 dummy variables. Create one variable for each factor level. You can then simply supply these variables as additional columns in your <data> argument.

Kay


--
You received this message because you are subscribed to the Google Groups "CausalImpact" group.
To unsubscribe from this group and stop receiving emails from it, send an email to causalimpact...@googlegroups.com.
To post to this group, send email to causal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/causalimpact/70e26ef9-78a5-4cc6-a302-45c371bbcc9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nitika gupta

unread,
Jan 8, 2015, 8:07:20 AM1/8/15
to causal...@googlegroups.com, nit....@gmail.com
Hi ,
 
Thanks for quick reply .
 
I tried putting that variable in 1/0 format ,but I am getting below error
 
           Error: !any(is.na(data[, -1])) is not TRUE
 
 
Thanks,
Nitika
Reply all
Reply to author
Forward
0 new messages