康卡特Bivariate(
Y( :Name( "Av_01_Age")),
X( :Name( "Av T2_Age"))
);
rev = colstoredvalue(smary,"Source_Table",1);
bal = colstoredvalue(smary,"Source_Table",2);
如何將rev和bal中的值分別連接到x和y?
回复:concat我假設在引用為“ smary”的數據表中,有一列稱為“ Source_Table”的列。 此外,第1行包含要用作X變量的數據表中一列的名稱,同一列的第2行包含要用作Y變量的列的名稱。 您的數據表看起來有點像

鑑於以上所述,這是使用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 ) )
);
我想我應該使用名稱AV_01_Age和AV T2_Age代替身高和體重。
如果這不是您想要的,請提供更多詳細信息,並可能提供示例數據。
回复:concat
這是我的數據的樣子。
我希望它適合y的x
如果手動完成,
Bivariate(
Y( :Name( "AV_01_Age 208103-UP-1" ) ),
X( :Name( "AV_01_Age 208103-DN-1" ) )
);
我想要這樣
Bivariate(
Y( :Name( "AV_01_Age ^char(up)^" ) ),
X( :Name( "AV_01_Age ^char(dn)^" ) )
);<BR /><BR />where up = 208103-UP-1<BR />dn = 208103-DN-1
回复:concat您需要做的就是簡單地使用
表格=>堆棧
進行多系列堆疊,這將使您堆疊兩列

然後,您可以對堆疊數據運行雙變量。 下面是一個簡單的腳本,其作用與交互運行時相同。 在JSL中,我可以自由地重命名Tables => Stack中出現的列,然後再運行Bivariate,因此名稱更有意義
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)
);
我強烈建議您花些時間閱讀名為“使用JMP”的文檔。 發現於
幫助=> JMP文檔庫
查找名為“使用JMP”的文檔
回复:concat只是一個簡短的說明 @ skyzvoir0001 在表中,第三列是字符。(它向左對齊)。並且所有其他列均為數字(右對齊)。 對於每個表,應將要合併或堆疊的列設置為相同的數據和建模類型。 特別是如果您打算在下一步中對列進行回歸。如果一列應該是數字及其字符,那麼您將獲得ANOVA而不是雙變量報告。
這是我處理此問題的方法:
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" );
)
);