# Weighted Variables (WGTD)

### Combining Multiple Variables with Custom Coefficients

Weighted Variables (WGTD) allow you to combine multiple related variables into a single composite variable using custom coefficients as weights. This is particularly useful for consolidating multiple channels or campaigns into one variable while maintaining the flexibility to adjust their relative importance.

***

### What Are Weighted Variables?

#### Combining Multiple Channels

Instead of including multiple related variables separately in your model, you can combine them into one weighted variable.

**Example - Multiple Digital Channels:**

```
Separate variables:
- PPC_Spend
- Meta_Spend  
- Instagram_Spend
- LinkedIn_Spend
- Display_Spend

Combined as:
Digital_Mix|WGTD
```

**Why:** Reduces model complexity, prevents multicollinearity, creates meaningful composites

***

### How It Works

#### Step 1: Test Variables

MixModeler first tests all selected variables to get their OLS coefficients.

**Example Test Results:**

```
PPC_Spend:       Coefficient = 0.8,  t-stat = 3.2
Meta_Spend:      Coefficient = 0.5,  t-stat = 2.1
Instagram_Spend: Coefficient = 0.4,  t-stat = 1.9
LinkedIn_Spend:  Coefficient = 0.3,  t-stat = 1.5
Display_Spend:   Coefficient = 0.6,  t-stat = 2.4
```

***

#### Step 2: Review and Adjust Weights

The interface shows you the coefficients and lets you modify them based on:

* Statistical significance (t-stats)
* Business knowledge
* Channel priorities
* Budget allocation strategies

**You can:**

* Accept the OLS coefficients as weights
* Manually adjust weights based on business logic
* Set some weights to zero (exclude channels)

***

#### Step 3: Create Weighted Variable

**Formula:**

```
Weighted_Var = w₁×Var₁ + w₂×Var₂ + w₃×Var₃ + ...
```

**Example:**

```
Digital_Mix = 0.8×PPC + 0.5×Meta + 0.4×Instagram + 0.3×LinkedIn + 0.6×Display
```

**Result:** Single variable representing combined digital effect

***

### Common Use Cases

#### Use Case 1: Consolidating Similar Channels

**Problem:** You have 5 different digital channels that are highly correlated

**Solution:**

```
Create: Digital_Mix|WGTD
Components: PPC, Meta, Instagram, LinkedIn, Display
Weights: Based on OLS coefficients or business priorities
```

**Benefit:** One variable instead of five, reduced multicollinearity

***

#### Use Case 2: Multiple TV Campaigns

**Problem:** Running 3 TV campaigns simultaneously (Campaign1, Campaign2, Campaign3)

**Solution:**

```
Create: TV_Total|WGTD
Components: TV_Campaign1, TV_Campaign2, TV_Campaign3
Weights: Adjust based on creative quality or reach
```

**Example Weights:**

```
Campaign1: 1.2 (best creative)
Campaign2: 1.0 (standard)
Campaign3: 0.8 (lower quality)
```

***

#### Use Case 3: Regional Media Mix

**Problem:** Different regional spends that should be combined

**Solution:**

```
Create: TV_National|WGTD
Components: TV_Northeast, TV_Southeast, TV_West, TV_Midwest
Weights: Based on market size or importance
```

***

#### Use Case 4: Channel with Sub-Channels

**Problem:** Social media has multiple platforms

**Solution:**

```
Create: Social_Media_Total|WGTD
Components: Facebook_Ads, Instagram_Ads, Twitter_Ads, TikTok_Ads
Weights: OLS coefficients or strategic priorities
```

***

### Creating Weighted Variables in MixModeler

#### Step-by-Step Process

**Step 1: Select Variables**

* Navigate to Variable Workshop
* Select multiple related variables (hold Ctrl/Cmd for multi-select)
* Click "Create Weighted Variable"

**Step 2: Test Variables**

* MixModeler runs OLS to get coefficients
* Results table shows:
  * Variable name
  * OLS Coefficient
  * T-statistic (significance)
  * Editable "Model Coefficient" field

**Step 3: Adjust Weights**

* Review OLS coefficients
* Modify "Model Coefficient" column as needed
* Enter custom weights based on:
  * Statistical significance (higher t-stat = more reliable)
  * Business priorities
  * Budget allocation
  * Channel importance

**Step 4: Name and Create**

* Enter base name (e.g., "Digital\_Mix")
* MixModeler creates: `Digital_Mix|WGTD`
* New variable appears in Variable Library

***

### Weight Selection Strategies

#### Strategy 1: Use OLS Coefficients (Data-Driven)

**When:** You trust the statistical relationships **How:** Accept default weights from test results **Example:**

```
PPC: 0.8 (highest coefficient)
Meta: 0.5
Display: 0.6
```

***

#### Strategy 2: Normalize by Significance (Conservative)

**When:** Want to weight by statistical confidence **How:** Use coefficient × (t-stat/2) as weight **Example:**

```
PPC: 0.8 × (3.2/2) = 1.28
Meta: 0.5 × (2.1/2) = 0.525
Display: 0.6 × (2.4/2) = 0.72
```

***

#### Strategy 3: Equal Weights (Simplest)

**When:** All channels equally important **How:** Set all weights to 1.0 **Example:**

```
PPC: 1.0
Meta: 1.0  
Display: 1.0
```

**Result:** Simple sum of all channels

***

#### Strategy 4: Business-Driven Weights

**When:** You have strategic priorities **How:** Set weights based on business importance **Example:**

```
PPC: 1.5 (priority channel)
Meta: 1.0 (standard)
Display: 0.7 (experimental)
```

***

### Interpreting Weighted Variables

#### In Model Results

**Model:**

```
Sales = β₀ + β₁×Digital_Mix|WGTD + ...
```

**If β₁ = 0.4:**

* A 1-unit increase in weighted digital spending → $0.40 increase in sales
* The "unit" is the weighted combination of all component channels

***

#### Component Contributions

**When you export to Excel:**

* Weighted variable contribution is automatically decomposed
* Each component gets proportional credit based on its weight
* Example: If Digital\_Mix contributes $100K total:
  * PPC contribution: proportional to its weight
  * Meta contribution: proportional to its weight
  * etc.

***

### Best Practices

#### ✅ Do's

**Group Related Variables** Combine channels that serve similar purpose or are highly correlated

**Use Meaningful Names** Name weighted variables descriptively: `Digital_Performance|WGTD`, `TV_Campaigns|WGTD`

**Document Weight Rationale** Record why you chose specific weights (statistical, business logic, both)

**Test Impact on Model** Compare model R² with weighted vs. separate variables

**Start with OLS Coefficients** Use statistical weights as starting point, then adjust if needed

**Adjust for Known Differences** If Campaign A has 2× better creative than Campaign B, adjust weight accordingly

***

#### ❌ Don'ts

**Don't Combine Unrelated Channels** Don't mix TV and Email just to reduce variables - they behave differently

**Don't Use Arbitrary Weights** Every weight should have a justification (statistical or business)

**Don't Ignore Multicollinearity** Purpose of weighted variables is often to address high VIF - verify it helps

**Don't Over-Combine** Keep some separation for actionable insights - don't combine everything into one variable

**Don't Forget to Update** If channel mix changes significantly, recreate weighted variable with new data

***

### Advantages of Weighted Variables

**Reduces Model Complexity** 10 digital channels → 1 weighted variable

**Addresses Multicollinearity** Highly correlated channels combined, reducing VIF

**Maintains Flexibility** Weights adjustable based on business knowledge

**Simplifies Interpretation** One coefficient for "total digital" easier to communicate

**Enables Fair Comparison** Channels weighted by effectiveness, not just raw spend

***

### When NOT to Use Weighted Variables

#### Don't Combine If:

❌ **Channels behave very differently** TV (brand) and Search (performance) should stay separate

❌ **You need channel-specific insights** If stakeholders want individual channel ROI, keep separate

❌ **Channels not correlated** If VIF is low (<3), no need to combine

❌ **Strategic importance differs drastically** If one channel is 10× more important, maybe keep separate

***

### Example Workflow

#### Consolidating Digital Channels

**Starting Variables:**

```
- PPC_Spend (coef: 0.8, t-stat: 3.2)
- Meta_Spend (coef: 0.5, t-stat: 2.1)
- Display_Spend (coef: 0.6, t-stat: 2.4)
- LinkedIn_Spend (coef: 0.3, t-stat: 1.5)
```

**Step 1:** Select all four variables

**Step 2:** Create weighted variable, review OLS results

**Step 3:** Adjust weights:

```
PPC: 0.8 (keep - high significance)
Meta: 0.5 (keep - moderate significance)
Display: 0.6 (keep - moderate significance)
LinkedIn: 0.4 (increase from 0.3 - strategic priority)
```

**Step 4:** Name: `Digital_Performance`

**Step 5:** Created: `Digital_Performance|WGTD`

**Result in Model:**

```
Sales = β₀ + β₁×Digital_Performance|WGTD + β₂×TV + ...

Instead of:
Sales = β₀ + β₁×PPC + β₂×Meta + β₃×Display + β₄×LinkedIn + β₅×TV + ...
```

**Benefit:** 4 fewer variables, cleaner model, same insights

***

### Summary

**Key Takeaways:**

⚖️ **WGTD = Weighted combination** of multiple variables with custom coefficients

📊 **Uses OLS coefficients as starting weights** - data-driven default

✏️ **Fully adjustable** - modify weights based on business logic

🎯 **Reduces model complexity** - many variables → one composite

📉 **Addresses multicollinearity** - combines correlated channels

💼 **Business flexibility** - weight channels by strategic importance

🔧 **Common uses** - digital channels, TV campaigns, regional media

Weighted variables are powerful for creating meaningful composites while maintaining statistical rigor and business relevance!
