Hello,
I want your help with finding an average of selected row in a column and use it as a reference line in a graph.
I have a data table:
A | 12.5 |
B | 13.4 |
B | 17.5 |
B | 12.8 |
A | 11.1 |
A | 19.4 |
B | 13.8 |
I want to make a variable that is an average of all the “B” line values ((13.4+17.5+12.8+13.8)/4) in the example above.
Then I am going to use it as a reference line in a Bivariate graph.
If I am understanding what you want correctly, try creating a new variable using the Col Mean function with your first column as a "By" variable. Then create another column with an IF statement that uses the B mean value for both groups A and B. That column will then all have the same value = mean of the group B values.
@ileshem ,
Once the data table is openend , select random rows . You can do this by :
Rows > Row Selection > Select Randomly
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
AgeVals = :age << Get Values ; // Get Values in Age Column
SR = dt << Get Selected Rows(); // Get Selected Rows
RequiredVar = AgeVals[SR,0]; // Desired Values subset from Column Values
@ileshem ,
Col Mean() - if you want to use the column
Mean() - if you want to use the matrix or a separate variable
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Randomly( 0.3 );
dt1 = dt << Subset(Selected Rows( 1 ), selected columns( 0 ));
Res = Col Mean(dt1:age);
Show(Res);
If I am understanding what you want correctly, try creating a new variable using the Col Mean function with your first column as a "By" variable. Then create another column with an IF statement that uses the B mean value for both groups A and B. That column will then all have the same value = mean of the group B values.