cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-470443%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3Ejsl%20%3A%20comment%20tracer%20en%20utilisant%20une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470443%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Esuite%20%C3%A0%20ce%20post%20%3A%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FScript-to-loop-thru-and-group-columns-by-name-dynamically%2Fm-p%2F470274%23M71439%22%20target%3D%22_blank%22%3E%20https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FScript-to-loop-thru-and-group-columns-by-name-dynamically%2Fmp%2F470274%23M71439%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJe%20regroupe%20plus%20de%2010%20000%20colonnes%20en%20groupes%20par%20StepID%2C%20mais%20j'essaie%20maintenant%20de%20toutes%20les%20tracer.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJe%20n'arrive%20pas%20vraiment%20%C3%A0%20comprendre%20comment%20lui%20dire%20de%20tracer%20selon%20la%20liste%20de%20tous%20les%20groupes.%20aucun%20conseil%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22aliegner1_0-1647456188001.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22aliegner1_0-1647456188001.png%22%20style%3D%22width%3A%20161px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22aliegner1_0-1647456188001.png%22%20style%3D%22width%3A%20161px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F40872i2CA8A3C6605206F5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22aliegner1_0-1647456188001.png%22%20alt%3D%22aliegner1_0-1647456188001.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F*plotting%20a%20basic%20Fit%20YbyX%20just%20to%20get%20pValues.%20Formatting%20and%20style%20done%20on%20final%20plot*%2F%0Aow1%20%3D%20Oneway(%0A%20Y(%20dtAggWide%26lt%3B%3CGET%20column%3D%22%22%20group%3D%22%22%3E%3C%2FGET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-470443%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EM%C3%A9lange%20et%20nettoyage%20des%20donn%C3%A9es%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-470857%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20%3A%20comment%20tracer%20%C3%A0%20l'aide%20d'une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470857%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EUn%20grand%20merci%20qui%20a%20r%C3%A9solu%20le%20probl%C3%A8me.Ma%20lecture%20du%20message%20n'avait%20pas%20d%C3%A9couvert%20la%20fonction%20get%20permettant%20d'extraire%20les%20informations%20dont%20j'avais%20besoin.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-470856%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20%3A%20comment%20tracer%20%C3%A0%20l'aide%20d'une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470856%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EMerci%20beaucoup%2C%20aucun%20de%20mes%20lecteurs%20n'avait%20d%C3%A9couvert%20la%20fonction%20get%20aidant%20%C3%A0%20extraire%20ces%20informations.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-470538%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20%3A%20comment%20tracer%20%C3%A0%20l'aide%20d'une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470538%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVoici%20une%20r%C3%A9%C3%A9criture%20du%20code%2C%20supprimant%20le%20besoin%20de%20cr%C3%A9er%20des%20expressions%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20Current%20Data%20Table()%3B%0Adt%26lt%3B%26lt%3B%20set%20name(%20%22AggWide%22%20)%3B%0A%0A%2F%2Fget%20the%20column%20groups%20and%20put%20them%20into%20one%20long%20list%0AcolgroupNames%20%3D%20dt%20%26lt%3B%26lt%3B%20get%20column%20groups%20names%3B%0AcolsList%20%3D%20%7B%7D%3B%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20colgroupNames%20)%2C%20i%2B%2B%2C%0A%20Insert%20Into(%20colsList%2C%20dt%20%26lt%3B%26lt%3B%20get%20column%20group(%20colgroupNames%5Bi%5D%20)%20)%0A)%3B%0A%0A%2F%2Ftemporary%20string%20for%20testing%0ARecipeStepIndex%20%3D%20%7B%2210.0.0.0.0.0%22%2C%20%2211.0.0.0.0.0%22%2C%20%2212.0.0.0.0.0%22%7D%3B%0A%0A%2F%2F%20Build%20a%20character%20string%20that%20represents%20the%20commands%20that%20need%20to%20be%20run%0Aow1%20%3D%20Oneway(%0A%20Y(%20Eval(%20colsList%20)%20)%0A%2C%0A%20X(%20%3AChamberID%20)%2C%20%0A%20%2F%2FBy(%3A)%2C%0A%20%0A%20%2F%2FAll%20pairs%20Tukey%20HSD%20test%0A%20All%20Pairs(%0A%20%201%2C%0A%20%20Confidence%20Quantile(%200%20)%2C%0A%20%20Difference%20Matrix(%200%20)%2C%0A%20%20LSD%20Threshold%20Matrix(%200%20)%2C%0A%20%20Connecting%20Letters%20Report(%200%20)%2C%0A%20%20Ordered%20Differences%20Report(%201%20)%0A%20)%2C%20%0A%20%2F%2Finvisible%2C%20%2F%2Fuse%20this%20to%20speed%20up.%0A)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-470534%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20%3A%20comment%20tracer%20%C3%A0%20l'aide%20d'une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470534%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Ealors%20j'ai%20extrait%20cette%20solution%20de%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2687%22%20target%3D%22_blank%22%3E%20%40txnelson%3C%2FA%3E%20%3A%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FScript-multiple-columns-grouped-in-distribution-plot%2Ftd-p%2F162557%22%20target%3D%22_blank%22%3E%20https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FScript-multiple-columns-grouped-in-distribution-plot%2Ftd-p%2F162557%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Emais%20je%20me%20demande%20s'il%20existe%20un%20moyen%20de%20parcourir%20simplement%20les%20noms%20de%20groupes%20plut%C3%B4t%20que%20de%20cr%C3%A9er%20cette%20expression.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0AdtAggWide%20%3D%20current%20data%20table()%3B%0AdtAggWide%20%26lt%3B%26lt%3B%20set%20name(%20%22AggWide%22)%3B%0A%0A%2F%2Fget%20the%20column%20groups%0AcolgroupNames%20%3D%20dt%20%26lt%3B%26lt%3B%20get%20column%20groups%20names%3B%0A%0A%2F%2Ftemporary%20string%20for%20testing%0ARecipeStepIndex%20%3D%7B%2210.0.0.0.0.0%22%2C%20%2211.0.0.0.0.0%22%2C%20%2212.0.0.0.0.0%22%7D%20%0A%0A%2F%2F%20Build%20a%20character%20string%20that%20represents%20the%20commands%20that%20need%20to%20be%20run%0AtheExpr_start%20%3D%20%22ow1%20%3D%20Oneway(%0A%20Y(%20dtAggWide%26lt%3B%3CGET%20column%3D%22%22%20group%3D%22%22%3E%3C%2FGET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-470512%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20%3A%20comment%20tracer%20%C3%A0%20l'aide%20d'une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470512%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOK%2C%20j'ai%20donc%20ceci%2C%20mais%20je%20ne%20sais%20pas%20comment%20continuer%20%C3%A0%20faire%20des%20boucles%20et%20%C3%A0%20cr%C3%A9er%20de%20nouveaux%20termes%20dans%20la%20section%20Y(.%3C%2FP%3E%3CP%3Eaucun%20conseil%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EcolgroupNames%20%3D%20dt%20%26lt%3B%26lt%3B%20get%20column%20groups%20names%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*plotting%20a%20basic%20Fit%20YbyX%20just%20to%20get%20pValues.%20Formatting%20and%20style%20done%20on%20final%20plot*%2F%3CBR%20%2F%3Eow1%20%3D%20Oneway(%3CBR%20%2F%3EY(%20dtAggWide%26lt%3B%3CGET%20column%3D%22%22%20group%3D%22%22%3E%3C%2FGET%3E%2C%20dtAggWide%26lt%3B%3CGET%20column%3D%22%22%20group%3D%22%22%3E%3C%2FGET%3E%2C%20dtAggWide%26lt%3B%3CGET%20column%3D%22%22%20group%3D%22%22%3E%3C%2FGET%3E)%2C%3CBR%20%2F%3EX(%20%3AChamberId%20)%2C%3CBR%20%2F%3E%2F%2FBy(%3A)%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%2F%2FAll%20pairs%20Tukey%20HSD%20test%3CBR%20%2F%3EAll%20Pairs(%3CBR%20%2F%3E1%2C%3CBR%20%2F%3EConfidence%20Quantile(%200%20)%2C%3CBR%20%2F%3EDifference%20Matrix(%200%20)%2C%3CBR%20%2F%3ELSD%20Threshold%20Matrix(%200%20)%2C%3CBR%20%2F%3EConnecting%20Letters%20Report(%200%20)%2C%3CBR%20%2F%3EOrdered%20Differences%20Report(%201%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3E%2F%2Finvisible%2C%20%2F%2Fuse%20this%20to%20speed%20up.%3CBR%20%2F%3E)%3BdtAggWide%20%3D%20current%20data%20table()%3B%0AdtAggWide%20%26lt%3B%26lt%3B%20set%20name(%20%22AggWide%22)%3B%0A%0ARecipeStepIndex%20%3D%7B%2210.0.0.0.0.0%22%2C%20%2211.0.0.0.0.0%22%2C%20%2212.0.0.0.0.0%22%7D%20%2F%2F%20column%20groups%20names.%20Each%20group%20has%20100%2B%20columns.%0A%0A%2F%2Ftrying%20to%20create%20a%20series%20of%20charts%20using%20the%20groups%2C%20looping%20through%20the%20groups%0Aow1%20%3D%20Oneway(%0A%20Y(%20%20for(%20i%20%3D%201%2C%20i%26lt%3B%3DNitems(%20RecipeStepIndex)%2C%20i%2B%2B%2C%0A%20%20%20dtAggWide%26lt%3B%3CGET%20column%3D%22%22%20group%3D%22%22%3E%3C%2FGET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-470467%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20%3A%20comment%20tracer%20%C3%A0%20l'aide%20d'une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470467%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EJe%20suis%20d%C3%A9sol%C3%A9%2C%20j'ai%20du%20mal%20ici.%3C%2FP%3E%3CP%3EJe%20ne%20sais%20pas%20pourquoi%20imbriquer%20l'evalexpr%26nbsp%3B%3F%3C%2FP%3E%3CP%3En'y%20a-t-il%20pas%20un%20moyen%20de%20remplacer%20le%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-jsl%22%3E%3CCODE%3EY(%20dtAggWide%26lt%3B%3CGET%20column%3D%22%22%20group%3D%22%22%3E%3C%2FGET%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eavec%20une%20liste%20de%20groupes%20de%20colonnes%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJ'ai%20d%C3%A9j%C3%A0%20cr%C3%A9%C3%A9%20cette%20liste%2C%20comment%20puis-je%20%C3%A9changer%20ce%20RecipeStepIndex%20dans%20les%20groupes%20Y%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2FBuild%20and%20prefill%20an%20Array%20of%20names%20of%20the%20RecipeStepId%0ASummarize(%20dt%2C%20RecipeStepIndex%20%3D%20by(%20%3ARecipeStepId)%20)%3B%2F%2Fget%20list%20of%20unique%20RecipeStepID's%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22aliegner1_0-1647461547191.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22aliegner1_0-1647461547191.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22aliegner1_0-1647461547191.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F40876iA686BFFE4C10DBE1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22aliegner1_0-1647461547191.png%22%20alt%3D%22aliegner1_0-1647461547191.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-470465%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20%3A%20comment%20tracer%20%C3%A0%20l'aide%20d'une%20liste%20de%20groupes%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-470465%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVous%20pouvez%20tr%C3%A8s%20probablement%20le%20faire%20avec%20quelque%20chose%20comme%20ceci%20(vous%20avez%20besoin%20d'EvalEvalExpr)%26nbsp%3B%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0Adt%20%26lt%3B%26lt%3B%20Group%20Columns(%22group1%22%2C%20%7B%22height%22%2C%20%22weight%22%7D)%3B%0A%0AEval(%0A%20EvalExpr(%0A%20%20dt%20%26lt%3B%26lt%3B%20Oneway(%0A%20%20%20Y(Expr(dt%20%26lt%3B%26lt%3B%20Get%20Column%20Group(%22group1%22)))%2C%20%0A%20%20%20X(%3Aage)%0A%20%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EVoir%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJSL-Cookbook-Archived%2FInsert-one-expression-into-another-using-Eval-Insert-Eval-Expr%2Fm-p%2F48998%23U48998%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-tkb-thread%20lia-fa-icon%20lia-fa-tkb%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%20Ins%C3%A9rez%20une%20expression%20dans%20une%20autre%20%C3%A0%20l'aide%20d'Eval%20Insert%2C%20Eval%20Expr%2C%20Parse%20et%20Substitute%3C%2FA%3E%20pour%20plus%20d'informations%20et%20des%20exemples%20sur%20Eval(EvalExpr())%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
aliegner1
Level IV

jsl: how to plot using a list of groups?

following up from this post: https://community.jmp.com/t5/Discussions/Script-to-loop-thru-and-group-columns-by-name-dynamically/m...

 

I'm grouping 10k+ columns into groups by StepID, but now trying to plot them all.

 

I can't quite figure out how to tell it to plot by the list of all the groups. any advice?

aliegner1_0-1647456188001.png

 

 

/*plotting a basic Fit YbyX just to get pValues. Formatting and style done on final plot*/
ow1 = Oneway(
	Y( dtAggWide<<get column group( "10.0.0.0.0.0" ) ),
	X( :ChamberId ),
	//By(:),
	
	//All pairs Tukey HSD test
	All Pairs(
		1,
		Confidence Quantile( 0 ),
		Difference Matrix( 0 ),
		LSD Threshold Matrix( 0 ),
		Connecting Letters Report( 0 ),
		Ordered Differences Report( 1 )
	),
	//invisible, //use this to speed up.
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: jsl: how to plot using a list of groups?

Here is a rewrite of the code, removing the need for expression building

Names Default To Here( 1 );
dt = Current Data Table();
dt<< set name( "AggWide" );

//get the column groups and put them into one long list
colgroupNames = dt << get column groups names;
colsList = {};
For( i = 1, i <= N Items( colgroupNames ), i++,
	Insert Into( colsList, dt << get column group( colgroupNames[i] ) )
);

//temporary string for testing
RecipeStepIndex = {"10.0.0.0.0.0", "11.0.0.0.0.0", "12.0.0.0.0.0"};

// Build a character string that represents the commands that need to be run
ow1 = Oneway(
	Y( Eval( colsList ) )
,
	X( :ChamberID ), 
	//By(:),
	
	//All pairs Tukey HSD test
	All Pairs(
		1,
		Confidence Quantile( 0 ),
		Difference Matrix( 0 ),
		LSD Threshold Matrix( 0 ),
		Connecting Letters Report( 0 ),
		Ordered Differences Report( 1 )
	), 
	//invisible, //use this to speed up.
);

 

Jim

View solution in original post

7 REPLIES 7
jthi
Super User

Re: jsl: how to plot using a list of groups?

You can most likely do it with something like this (you need EvalEvalExpr):

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Group Columns("group1", {"height", "weight"});

Eval(
	EvalExpr(
		dt << Oneway(
			Y(Expr(dt << Get Column Group("group1"))), 
			X(:age)
		)
	)
);

See Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute for more information and examples about Eval(EvalExpr())

-Jarmo
aliegner1
Level IV

Re: jsl: how to plot using a list of groups?

I'm sorry, i'm struggling here. 

I'm not sure why nesting the evalexpr?

is there not a way to replace the 

Y( dtAggWide<<get column group( "10.0.0.0.0.0" ) ),

with a list of column groups?

 

I previously created this list, how can I swap this RecipeStepIndex into the Y groups

//Build and prefill an Array of names of the RecipeStepId
Summarize( dt, RecipeStepIndex = by( :RecipeStepId) );//get list of unique RecipeStepID's

aliegner1_0-1647461547191.png

 

aliegner1
Level IV

Re: jsl: how to plot using a list of groups?

 

OK, so I've got this, but I'm not sure how I can keep looping and creating new terms inside the Y( section.

any advice?

 

colgroupNames = dt << get column groups names;

/*plotting a basic Fit YbyX just to get pValues. Formatting and style done on final plot*/
ow1 = Oneway(
Y( dtAggWide<<get column group( colgroupNames[1] )
, dtAggWide<<get column group( colgroupNames[2] )
, dtAggWide<<get column group( colgroupNames[3] )
),
X( :ChamberId ),
//By(:),

//All pairs Tukey HSD test
All Pairs(
1,
Confidence Quantile( 0 ),
Difference Matrix( 0 ),
LSD Threshold Matrix( 0 ),
Connecting Letters Report( 0 ),
Ordered Differences Report( 1 )
),
//invisible, //use this to speed up.
);dtAggWide = current data table(); dtAggWide << set name( "AggWide"); RecipeStepIndex ={"10.0.0.0.0.0", "11.0.0.0.0.0", "12.0.0.0.0.0"} // column groups names. Each group has 100+ columns. //trying to create a series of charts using the groups, looping through the groups ow1 = Oneway( Y( for( i = 1, i<=Nitems( RecipeStepIndex), i++, dtAggWide<<get column group( RecipeStepIndex[i] )) ), X( :ChamberId ), //By(:), //All pairs Tukey HSD test All Pairs( 1, Confidence Quantile( 0 ), Difference Matrix( 0 ), LSD Threshold Matrix( 0 ), Connecting Letters Report( 0 ), Ordered Differences Report( 1 ) ), //invisible, //use this to speed up. );
aliegner1
Level IV

Re: jsl: how to plot using a list of groups?

so I ripped this solution from @txnelson : https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/td-p/1...

 

but wondering if there's a way to just loop through the group names rather than doing this expression building thing.

 

Names Default To Here( 1 );
dtAggWide = current data table();
dtAggWide << set name( "AggWide");

//get the column groups
colgroupNames = dt << get column groups names;

//temporary string for testing
RecipeStepIndex ={"10.0.0.0.0.0", "11.0.0.0.0.0", "12.0.0.0.0.0"} 

// Build a character string that represents the commands that need to be run
theExpr_start = "ow1 = Oneway(
	Y( dtAggWide<<get column group( colgroupNames[1] )";
	
theExpr_end = "	),
	X( :ChamberId ),
	//By(:),
	
	//All pairs Tukey HSD test
	All Pairs(
		1,
		Confidence Quantile( 0 ),
		Difference Matrix( 0 ),
		LSD Threshold Matrix( 0 ),
		Connecting Letters Report( 0 ),
		Ordered Differences Report( 1 )
	),
	//invisible, //use this to speed up.
);";
	
//Loop across the remaining column groups in the colgroupNames list and generate the series of charts
For( i = 2, i <= N Items( colgroupNames ), i++,
	theExpr_start = theExpr_start || ", dtAggWide<<get column group( colgroupNames[" || Char( i ) || "] )"
);

//combine the strings
theExpr_final = theExpr_start || theExpr_end;

//Execute the code generated and placed into the character string variable
Eval( Parse( theExpr_final ) );
txnelson
Super User

Re: jsl: how to plot using a list of groups?

Here is a rewrite of the code, removing the need for expression building

Names Default To Here( 1 );
dt = Current Data Table();
dt<< set name( "AggWide" );

//get the column groups and put them into one long list
colgroupNames = dt << get column groups names;
colsList = {};
For( i = 1, i <= N Items( colgroupNames ), i++,
	Insert Into( colsList, dt << get column group( colgroupNames[i] ) )
);

//temporary string for testing
RecipeStepIndex = {"10.0.0.0.0.0", "11.0.0.0.0.0", "12.0.0.0.0.0"};

// Build a character string that represents the commands that need to be run
ow1 = Oneway(
	Y( Eval( colsList ) )
,
	X( :ChamberID ), 
	//By(:),
	
	//All pairs Tukey HSD test
	All Pairs(
		1,
		Confidence Quantile( 0 ),
		Difference Matrix( 0 ),
		LSD Threshold Matrix( 0 ),
		Connecting Letters Report( 0 ),
		Ordered Differences Report( 1 )
	), 
	//invisible, //use this to speed up.
);

 

Jim
TDF
TDF
Level II

Re: jsl: how to plot using a list of groups?

Thank you very much, none of my post reading had discovered the get function helping to draw that information out.

TDF
TDF
Level II

Re: jsl: how to plot using a list of groups?

Many thanks that solved the problem.  My post reading had not discovered the get function to draw out the information I required.

Recommended Articles