Hi,
I'm running a distribution analysis on a variable and I would need to extract the mean, and std dev of it's relevan normal, lognormal, gamma and weibull distribution. As well as, the goodness of fit statistics.
Thank you!
Solved! Go to Solution.
Do you want the good news or the bad news? The good news is that it "should" be doable.... I'd save my distribution analysis with a new name first and then start experimenting - some of it as you can see is fairly straightforward adding browses and then turning them into macro ouputs... For the real good stuff - I think you'll need to go into the R code shown below and make some edits to what and how things are being output. I'll try to take a quick look at it tonight.
So there are only 5 output anchors from the R tool. You can go in an bump something else but here's my current solution...
Go into the R in your distribution analysis macro - find the section pictured above. Write the variable stats to a .csv file of your choosing. Bring it into your workflow later. See as pictured. Note - you can bump something else and have it write directly to an Alteryx/R out port. I'd recommmend detaching the report section that follows, adding a macro output instead and not doing this to any anchors which actually continue in the macro.
I've just added macro outputs after each of the R outputs (Except the quant one) and the code runs fine with the normal distribution analysis but with the one with the macro outputs I get this error:
Error: Distribution Analysis (20): Tool #9: Error in stats::optim(x = c(40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, :
The original distribution analysis runs fine with the same data and outputs a report
Did you follow my write.csv instructions in my second post? In the above post did you change anything inside of R or just hook up new browses and change to macro outputs? If it's the later - I do not see how that can be generating different results or an error. So first run the macro as a general workflow. Close it. save it. then run in your workflow and see if it's still generating the error.
If it's the former - and you changed underlying R or workflow - I'd recommend implementing the browse in a different section. This is a bit of a trial and error process as again - there are only 5 outputs and Alteryx doesn't provide this data as a standalone. I do think the .csv export is probably the way to go since it makes the most minimal changes to the original tool/macro.
I added outputs at the end of the R tool again and for some reason it worked this time!
Thank you for your help!
User | Count |
---|---|
17 | |
15 | |
14 | |
6 | |
6 |