cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-7803%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EKombinieren%20von%20Werten%20mehrerer%20Spalten%20in%20einer%20Spalte%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7803%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CP%3EIch%20habe%20einen%20Datensatz%2C%20in%20dem%20ich%20vier%20Spalten%20zu%20einer%20Spalte%20zusammenf%C3%BChren%20m%C3%B6chte%3C%2FP%3E%3CP%3EDie%20Werte%20der%20vier%20Spalten%20werden%20in%20einer%20Spalte%20angezeigt.%20Allerdings%20habe%20ich%20keine%20Ahnung%2C%20wie%20das%20geht.%3C%2FP%3E%3CP%3EIch%20habe%20vier%20Bedingungen%2C%20denen%20die%20Befragten%20je%20nach%20Tag%20des%20Monats%20ausgesetzt%20waren%3C%2FP%3E%3CP%3ESie%20sind%20geboren.%20Wenn%20ein%20Befragter%20Bedingung%201%20ausgesetzt%20war%2C%20wird%20eine%201%20und%20dasselbe%20f%C3%BCr%20angezeigt%3C%2FP%3E%3CP%3EBedingungen%202%2C3%20und%204.%20Wie%20kann%20ich%20die%20Einsen%20jeder%20Spalte%20einfach%20in%20Namen%20umkodieren%20und%20diese%20dann%20zusammenf%C3%BChren%3F%3C%2FP%3E%3CP%3Evier%20Spalten%20in%20eine%20Spalte%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EDanke!%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%224584_Screen%20Shot%202013-11-30%20at%2011.53.23.png%22%20style%3D%22width%3A%20398px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%224584_Screen%20Shot%202013-11-30%20at%2011.53.23.png%22%20style%3D%22width%3A%20398px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%224584_Screen%20Shot%202013-11-30%20at%2011.53.23.png%22%20style%3D%22width%3A%20398px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F282i539B9E9BDD596356%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%224584_Screen%20Shot%202013-11-30%20at%2011.53.23.png%22%20alt%3D%224584_Screen%20Shot%202013-11-30%20at%2011.53.23.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-281033%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Werte%20mehrerer%20Spalten%20in%20einer%20Spalte%20kombinieren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-281033%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EWelch%20ist%20ein%20t-Test%20f%C3%BCr%20F%C3%A4lle%2C%20in%20denen%20die%20Annahme%20der%20Homogenit%C3%A4t%20der%20Varianz%20verletzt%20wird.%20Die%20meisten%20Leute%20w%C3%BCrden%20hierf%C3%BCr%20lieber%20einen%20nichtparametrischen%20Test%20verwenden.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7807%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Werte%20mehrerer%20Spalten%20in%20einer%20Spalte%20kombinieren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7807%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVielen%20Dank%20f%C3%BCr%20Ihre%20Antworten.%20Ich%20habe%20es%20herausgefunden.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ENoch%20eine%20Frage%3A%20Wenn%20ich%20einen%20Test%20auf%20Varianzhomogenit%C3%A4t%20durchf%C3%BChre%2C%20erhalte%20ich%20nach%20dem%20Levene-Test%2C%20Brown-Forsythe%20usw.%20einen%20Welch-Test.%20Kann%20jemand%20erkl%C3%A4ren%2C%20was%20genau%20der%20Welch-Test%20zeigt%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7806%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Werte%20mehrerer%20Spalten%20in%20einer%20Spalte%20kombinieren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7806%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CBLOCKQUOTE%3E%0A%3CP%3EWie%20kann%20ich%20die%20Einsen%20jeder%20Spalte%20einfach%20in%20Namen%20umwandeln%20und%20dann%20die%20vier%20Spalten%20zu%20einer%20Spalte%20zusammenf%C3%BChren%3F%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3ESie%20haben%20eine%20zweiteilige%20Frage%20gestellt.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1)%20Wie%20kodiere%20ich%20die%20Einsen%20in%20Namen%20um%3F%20Hierf%C3%BCr%20k%C3%B6nnen%20Sie%20verwenden%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2F13%2FRecode_Data.shtml%23791384%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Neu%20kodieren%3C%2FA%3E%20.%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%3CDIV%20class%3D%22video-embed-center%20video-embed%22%3E%3CIFRAME%20class%3D%22embedly-embed%22%20src%3D%22https%3A%2F%2Fcdn.embedly.com%2Fwidgets%2Fmedia.html%3Fsrc%3Dhttps%253A%252F%252Fwww.youtube.com%252Fembed%252FxcP476FSnQE%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DxcP476FSnQE%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252FxcP476FSnQE%252Fhqdefault.jpg%26amp%3Bkey%3Db0d40caa4f094c68be7c29880b16f56e%26amp%3Btype%3Dtext%252Fhtml%26amp%3Bschema%3Dyoutube%22%20width%3D%22400%22%20height%3D%22225%22%20scrolling%3D%22no%22%20title%3D%22Verwenden%20von%20JMP%2012%20Recode%22%20frameborder%3D%220%22%20allow%3D%22autoplay%3B%20fullscreen%22%20allowfullscreen%3D%22true%22%3E%3C%2FIFRAME%3E%3C%2FDIV%3E%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2)%20Wie%20f%C3%BCge%20ich%20vier%20Spalten%20zu%20einer%20Spalte%20zusammen%3F%20Hierf%C3%BCr%20ben%C3%B6tigen%20Sie%20eine%3CA%20href%3D%22http%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2F13-2%2FFormula_Editor.shtml%23%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Formel%3C%2FA%3E%20%2C%20Verwendung%20der%3CA%20href%3D%22http%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2F13-2%2FCharacter_Functions.shtml%23193150%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Konkat%3C%2FA%3E%20Funktion%20oder%20Operator.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JMPScreenSnapz120.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JMPScreenSnapz120.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JMPScreenSnapz120.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F7440i6F5D5C4FCD130302%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JMPScreenSnapz120.png%22%20alt%3D%22JMPScreenSnapz120.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7805%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Werte%20mehrerer%20Spalten%20in%20einer%20Spalte%20kombinieren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7805%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EWenn%20Sie%20die%20Einsen%20in%20Namen%20umwandeln%20m%C3%B6chten%2C%20erstellen%20Sie%20neue%20Spalten%20mit%20den%20neu%20kodierten%20Werten%20f%C3%BCr%20sich%20selbst%20und%20f%C3%BChren%20dann%20einfach%20alle%20Daten%20mit%20cat%2C%20%7C%7C%20usw.%20zusammen.%20Es%20gibt%20viele%20M%C3%B6glichkeiten%2C%20in%20sas%20zu%20verketten.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESehen%20Sie%20sich%20zum%20Beispiel%20den%20(ungetesteten)%20Code%20unten%20an.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EDatenantwort(drop%3DVariable1new--Variable4New)%3B%3C%2FP%3E%3CP%3Eeingestellt%20haben%3B%3C%2FP%3E%3CP%3Ewenn%20Variable1%3D1%20dann%20Variable1New%3D%22IHR%20TEXT%22%3B%3C%2FP%3E%3CP%3Ewenn%20Variable2%3D1%20dann%20Variable2New%3D%22IHR%20TEXT%22%3B%3C%2FP%3E%3CP%3Ewenn%20Variable3%3D1%20dann%20Variable3New%3D%22IHR%20TEXT%22%3B%3C%2FP%3E%3CP%3Ewenn%20Variable4%3D1%20dann%20Variable4New%3D%22IHR%20TEXT%22%3B%3C%2FP%3E%3CP%3EFinalVariable%3DCatx('%2C'%2C%20of%20Variable1New--Variable4New)%3B%3C%2FP%3E%3CP%3Elaufen%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESchauen%20Sie%20sich%20die%20Catx-Funktion%20an%2C%20da%20ich%20sie%20nicht%20auswendig%20kann.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESuchst%20du%20danach%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-7804%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Werte%20mehrerer%20Spalten%20in%20einer%20Spalte%20kombinieren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-7804%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDas%20Kombinieren%20von%20Spalten%20ist%20nicht%20schwer%20%E2%80%93%20Sie%20k%C3%B6nnen%20eine%20Spaltenformel%20verwenden.Allerdings%20f%C3%A4llt%20es%20mir%20schwer%2C%20genau%20zu%20verstehen%2C%20was%20Sie%20tun%20m%C3%B6chten.K%C3%B6nnen%20Sie%20etwas%20mehr%20Daten%20bereitstellen%20und%20wie%20die%20endg%C3%BCltige%20Ausgabe%20aussehen%20soll%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
nikolaj
Level I

Combining values of multiple columns into one column

I have a data set where I would like to merge four columns  into one column, so that

the values of the four columns are displayed in one column. However, I have no clue how to do that.

I have four conditions, which respondents have been exposed to depending on the day of the month

they are born. If a respondent has been exposed to Condition 1 it shows a 1 and the same for

conditions 2,3, and 4. How can I easily recode the 1's of each column into names and then merge the

four columns into one column?

Thanks!

4584_Screen Shot 2013-11-30 at 11.53.23.png

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: Combining values of multiple columns into one column

How can I easily recode the 1's of each column into names and then merge the four columns into one column?

You've asked a two-part question.

 

 

1) How do I recode the 1's into names? For this you can use Recode.

 

2) How do I merge four columns into one column? For this you need a Formula, using the Concat function or operator.

JMPScreenSnapz120.png

 

-Jeff

View solution in original post

5 REPLIES 5
pmroz
Super User

Re: Combining values of multiple columns into one column

Combining columns is not hard - you can use a column formula.  However I'm having difficulty understanding exactly what you want to do.  Can you provide a little more data, and what you want the final output to look like?

anotherdream
Level I

Re: Combining values of multiple columns into one column

If you want to re-code the 1's into names, you would make new columns that have the re-coded values for yourself, then simply merge all the data together using cat, ||, etc.. There are many ways to concatenate in sas..

So for example, see the (untested) code below.

Data answer(drop=Variable1new--Variable4New);

set have;

if Variable1=1 then Variable1New="YOUR TEXT";

if Variable2=1 then Variable2New="YOUR TEXT";

if Variable3=1 then Variable3New="YOUR TEXT";

if Variable4=1 then Variable4New="YOUR TEXT";

FinalVariable=Catx(',', of Variable1New--Variable4New);

run;

Look into the catx function since I don't have it memorized.

Is this what you are looking for?

Jeff_Perkinson
Community Manager Community Manager

Re: Combining values of multiple columns into one column

How can I easily recode the 1's of each column into names and then merge the four columns into one column?

You've asked a two-part question.

 

 

1) How do I recode the 1's into names? For this you can use Recode.

 

2) How do I merge four columns into one column? For this you need a Formula, using the Concat function or operator.

JMPScreenSnapz120.png

 

-Jeff
nikolaj
Level I

Re: Combining values of multiple columns into one column

Thank you for your responses. I figured it out.

Another question: When I run a test for variance homogeneity I get a Welch's test after the levene's test, brown-forsythe etc. Can someone explain what exactly the Welch's test shows?

ezorlo
Level IV

Re: Combining values of multiple columns into one column

Welch is a t-test for instances where the homogeneity of variance assumption is violated. most ppl would prefer to use a non-parametric test for this.

Recommended Articles