I am working on the data where I am required to transform the data into a pivot table in tableau and then pull all the required charts and analysis.
I am required to do regression analysis for which I have integrated R with tableau. Now the issue is while using the SCRIPT function how will I refer/indicate which is dependent variable and which all are independent variables in the regression formula, as after transforming all the variable will be referred as "Pivot Field Names" and "Pivot Field Values".
fit<- lm(.arg1 ~ .arg2 + .arg3 + .arg4)
[Pivot Field Values]
Also note, we have multiple columns which needs to be clubbed under single header (Like Store 1,2,3 & 4 as "Stores"). Likewise, we need to club the other variables i.e.Location, Age Category and WTD. We have created multiple sets (for Stores, Location, Age Category & WTD) and then tried performing regression analysis, not sure what am I missing out, I am getting an error message,
Looking for an tableau output as below:
STORE LIST REGRESSION VALUES
Here is the attached Sample workbook along with sample data and R error screenshot.
Your immediate response would be highly appreciated. Many Thanks!