facebookexperimental / facebookexperimental/Robyn

Error in check_context(dt_input, context_vars, context_signs) : Allowed values for 'context_signs' are: positive, negative, default

Open
#1,161 1 comment 0 reactions 1 assignee Claimed by @gufengzhou View on GitHub
Dominant language
Jupyter Notebook
Stars
1.5k
Forks
433
PR merge metrics
No merged PRs in 30d

Description

## Project Robyn

## Describe issue
Working with a data set that has many contextual variables and keep getting the following error. I know I need to adjust something about the data set, but I'm not sure what. Any guidance would be helpful.

```
Error in check_context(dt_input, context_vars, context_signs) :
Allowed values for 'context_signs' are: positive, negative, default
```

## Provide reproducible example
Blinded sample data set: [MMMWeeklyV2.xlsx](https://github.com/user-attachments/files/17873131/MMMWeeklyV2.xlsx)

```
InputCollect <- robyn_inputs(
dt_input = MMMWeeklyV2,
dt_holidays = dt_prophet_holidays,
date_var = "Date", # date format must be "2020-01-01"
dep_var = "Revenue", # there should be only one dependent variable
dep_var_type = "revenue", # "revenue" (ROI) or "conversion" (CPA)
prophet_vars = c("trend", "season", "holiday"), # "trend","season", "weekday" & "holiday"
prophet_country = "US", # input country code. Check: dt_prophet_holidays
context_vars = c("econactiv", "privatehousingunits", "thirtyyrmortgage", "vehiclesales", "primeloan"), # e.g. competitors, discount, unemployment etc
paid_media_spends = c("Radio_S", "DSPDis_S", "DSPVid_S", "DSPAud_S", "FBBrand_S", "FBNonBrand_S", "GoogleBrand_S", "GoogleNonBrand_S", "YouTube_S"), # mandatory input
paid_media_vars = c("Radio_S", "DSPDis_I", "DSPVid_I", "DSPAud_I", "FBBrand_I", "FBNonBrand_I", "GoogleBrand_I", "GoogleNonBrand_I", "YouTube_I" ), # mandatory.
# paid_media_vars must have same order as paid_media_spends. Use media exposure metrics like
# impressions, GRP etc. If not applicable, use spend instead.
organic_vars = "Promo_NIL", "Promo_Home", "Promo_Product", "Event", # marketing activity without media spend
factor_vars = c("Promo_NIL", "Promo_Home", "Promo_Product", "Event"), # force variables in context_vars or organic_vars to be categorical
window_start = "2018-12-30",
window_end = "2024-08-25",
adstock = "geometric" # geometric, weibull_cdf or weibull_pdf.
)
print(InputCollect)
```

## Environment & Robyn version
Make sure you're using the latest Robyn version before you post an issue.
- Robyn version 3.11.1
- R version 4.3.3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.