Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Storing variables based on p-value

kristinecp
6 - Meteoroid

Hello, I'm new to alteryx. I need help storing variables from the linear regression I am running with p-values less than 0.05.

What i'm trying to do is similar to this thread (https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Pulling-data-from-Linear-Regression-re...) but I only want variables with less than 0.05 p-value.

I tried tweaking Dr.Dan's code hy adding "[which(mod.obj$coefficients[, 4] <0.05)]" after mod.obj$coefficients but I realized it wasn't the regression summary table it was calling so column 4 does not exist. How can I specify what variables to store based on p-value?

4 REPLIES 4
joshuaburkhow
ACE Emeritus
ACE Emeritus

Unfortunately I am having some issues with some of the macros on my machine so I can't test/build an example for you but did you try the "Model Coefficients" tool that @chris_love  and @DrDan mentioned in that post? 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
kristinecp
6 - Meteoroid

Yes, I was able to extract the variables and coefficients using Dr. Dan's macro but some of the variables pulled out had p-values greater than 0.05. I was hoping to have some control over which variables were extracted and select only those with less than 0.05 alpha. But thanks, anyway!

joshuaburkhow
ACE Emeritus
ACE Emeritus

So it sounds like you might be trying to widdle down the number of variables in your model? If so there is the Stepwise tool that does that....

 

Screen Shot 2019-09-25 at 11.46.01 PM.png

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
kristinecp
6 - Meteoroid

Thanks, I've explored this tool and it seems like this is the closest I can get. I used AIC but BIC is much more restrictive. Though, I still wonder if I can pull out variables with specific p-values. For example, in R i can store the model's output in dataframe B and use "B$B[B$p.value < 0.05]" to do it. I guess using BIC is okay for now, but if you could help me with it on Alteryx...that would be great!🙂

Labels