Choose Language Hide Translation Bar
Highlighted
skyzvoir0001
Level III

concat

Bivariate(
	Y( :Name( "Av_01_Age")),
	X( :Name( "Av T2_Age"))
);


rev = colstoredvalue(smary,"Source_Table",1);
bal = colstoredvalue(smary,"Source_Table",2);

How do i concat the values in rev and bal to x & y respectively?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
txnelson
Super User

Re: concat

I am assuming that in your data table referenced as "smary" you have a column called column called "Source_Table".  Furthermore, row 1 contains the name of a column in your data table that you want to use as your X variable, and row 2 for the same column contains the name of the column you want to use for the Y variable.  Your data table would look somethin like

example.PNG

Given the above, here is the code to run the columns Height and Weight using Bivariate

names default to here(1);
smary=current data table();

rev = colstoredvalue(smary,:Source_Table,1);
bal = colstoredvalue(smary,:Source_Table,2);

bivariate(
	Y( column( bal) ),
	X( column( rev ) )
);

 I guess I should have used the names AV_01_Age and AV T2_Age instead of height and weight.

If this is not what you are asking for, please provide more specifics and possibly sample data.

Jim

View solution in original post

Highlighted
Byron_JMP
Staff

Re: concat

Just a quick note @skyzvoir0001 in your tables, the third column is character. (its aligned to the left). And all the other columns are numeric (aligned to the right).   For each table, you should set the columns that you intend to concat or stack to the same data and modeling types.   Especially if you intend to do a regression of the columns in the next step. If one column is supposed to be numeric and its character, then you'll get ANOVA rather than Bivariate reports.

 

This is how I work with this problem:

tables = {dtcon, dtrec, dtdea}; //list of the tables I need to format

For( ii = 1, ii <= N Items( tables ), ii++,          // this outside loop is for each table
	For( i = 3, i <= N Cols( tables[ii] ), i++,      // this inside loop is for each col in each table
                                                     // i=3 because I want every column after the 3rd col to be formatted.
			Column( tables[ii], i ) << Set Data Type( "Numeric" );
			Column( tables[ii], i ) << Set Modeling Type( "Continuous" );
	)
);
JMP Systems Engineer, Pharm and BioPharm Sciences

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

Re: concat

I am assuming that in your data table referenced as "smary" you have a column called column called "Source_Table".  Furthermore, row 1 contains the name of a column in your data table that you want to use as your X variable, and row 2 for the same column contains the name of the column you want to use for the Y variable.  Your data table would look somethin like

example.PNG

Given the above, here is the code to run the columns Height and Weight using Bivariate

names default to here(1);
smary=current data table();

rev = colstoredvalue(smary,:Source_Table,1);
bal = colstoredvalue(smary,:Source_Table,2);

bivariate(
	Y( column( bal) ),
	X( column( rev ) )
);

 I guess I should have used the names AV_01_Age and AV T2_Age instead of height and weight.

If this is not what you are asking for, please provide more specifics and possibly sample data.

Jim

View solution in original post

Highlighted
skyzvoir0001
Level III

Re: concat

Capture12.PNG
Here's how my data looks like.


I wanted it to fit x by y

from which if manually done,

Bivariate(
	Y( :Name( "AV_01_Age 208103-UP-1" ) ),
	X( :Name( "AV_01_Age 208103-DN-1" ) )
);

i wanted it like this

Bivariate(
	Y( :Name( "AV_01_Age ^char(up)^" ) ),
	X( :Name( "AV_01_Age ^char(dn)^" ) )
);

where up = 208103-UP-1
dn = 208103-DN-1
Highlighted
txnelson
Super User

Re: concat

What you need to do, is to simply stack the data using

     Tables=>Stack

Do a Multiple Series Stack, which will give you the 2 columns stacked

 stacked.PNG

Then you can run the Bivariate on the stacked data.  Below is a simple script that does the same thing as if you were running it interactively.  In the JSL I took the liberty to rename the columns that come out from the Tables=>Stack, before running the Bivariate, so the names are more meaningful

names default to here(1);
// Create your sample data table
dt=New Table( "Example",
	Add Rows( 6 ),
	New Column( "AV_01)Age 28103-UP-1",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [3, 4, 5, 6, 12, 11] )
	),
	New Column( "AV_01_Age 208103-DN-1",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [7, 8, 6, 3, 8, 10] ),
		Set Display Width( 120 )
	),
	New Column( "AD_01Pref 208104-UP-1",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [9, 4, 8, 6, 7, 8] )
	),
	New Column( "AD_01_Pref 208104-DN-1",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [12, 5, 7, 9, 8, 7] )
	)
);

// Stack the UP columns and the DN columns
dtStack = dt << Stack(
	columns(
		:Name( "AV_01)Age 28103-UP-1" ),
		:Name( "AV_01_Age 208103-DN-1" ),
		:Name( "AD_01Pref 208104-UP-1" ),
		:Name( "AD_01_Pref 208104-DN-1" )
	),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" ),
	Number of Series( 2 )
);

// Rename the columns
dtStack:Data << set name("AV_01_Age UP");
dtStack:Data2 << set name("AV_01_Age DN");

// Run the Bivariate
dtStack << Bivariate( Y(:AV_01_Age UP),
				 X(:AV_01_Age DN)
);

I strongly suggest that you take the time to read the documentation called Using JMP.  It is found at

     Help=>JMP Documentation Library

Look for the document called "Using JMP"

Jim
Highlighted
Byron_JMP
Staff

Re: concat

Just a quick note @skyzvoir0001 in your tables, the third column is character. (its aligned to the left). And all the other columns are numeric (aligned to the right).   For each table, you should set the columns that you intend to concat or stack to the same data and modeling types.   Especially if you intend to do a regression of the columns in the next step. If one column is supposed to be numeric and its character, then you'll get ANOVA rather than Bivariate reports.

 

This is how I work with this problem:

tables = {dtcon, dtrec, dtdea}; //list of the tables I need to format

For( ii = 1, ii <= N Items( tables ), ii++,          // this outside loop is for each table
	For( i = 3, i <= N Cols( tables[ii] ), i++,      // this inside loop is for each col in each table
                                                     // i=3 because I want every column after the 3rd col to be formatted.
			Column( tables[ii], i ) << Set Data Type( "Numeric" );
			Column( tables[ii], i ) << Set Modeling Type( "Continuous" );
	)
);
JMP Systems Engineer, Pharm and BioPharm Sciences

View solution in original post

Article Labels

    There are no labels assigned to this post.