Trouble keeping track of sample annotations for performing a one-sample t-test on a large datasetHello,
I'm trying to put together a script which would determine whether a data (XYZ %) collected for a specific subject (unique_subject_id) is significantly different from a reference population (such as vehicle in 'test_article_type' column). In addition, for a given subject there can be several data collected across multiple locations (variables).
Running the one-sample t-test seems simple enough but I'm struggling to find a way to carry along the 'unique_subject_id and variables' info along when running the 'test mean' option in distribution platform making use of the 'XYZ %' value for each 'unique_subject_id_variables' using a for loop.
I can't think of a way to way to carry over the 'unique_subject_id_variables' label into the distribution platform to enable bring the Pvalue generated back into the parent table without a risk of mix up.
Any suggestions would be greatly appreciated.
Best,
Sebastien
// The distribution for the "XYZ % (Norm to Ctrl Gene/Ctrl Grp)" is assessed for each variables separately for the 'vehicle' samples only ('test_article_type')
//This is used as the starting point to assess whether each "XYZ % (Norm to Ctrl Gene/Ctrl Grp)" values for every unique_subject_id is similar or not to the a reference population (ie 'vehicle') for their respective variables.
// the unique_subject_id_variables is not carried over in the pvalue report table so there is a risk of mix up when merging the Pvalue back to the main table
Names Default To Here( 1 );
Clear Log();
try(data Table( "one sample t-test validation Anonymized")<<CLOSE window=""></CLOSE>ScriptingRe: Trouble keeping track of sample annotations for performing a one-sample t-test on a large datasetso, your script is doing what you think it is but its always little risky just hoping everything stays in the same order. or at least it makes me nervous.
I made a couple of little tweaks so that it makes a labeled table. The wide format isn't ideal, but that can be stacked and joined back to your data. I'll let you sort that part out.
also, there was this comment about this line
//By( :variables )// does not appear to be used by the platform
just a note ":variables" refers to a column in the data table, but the table doesn't have a column with that name, so it doesn't do anything.
here's the JSL, hope it makes sense
// The distribution for the "XYZ % (Norm to Ctrl Gene/Ctrl Grp)" is assessed for each variables separately for the 'vehicle' samples only ('test_article_type')
//This is used as the starting point to assess whether each "XYZ % (Norm to Ctrl Gene/Ctrl Grp)" values for every unique_subject_id is similar or not to the a reference population (ie 'vehicle') for their respective variables.
// the unique_subject_id_variables is not carried over in the pvalue report table so there is a risk of mix up when merging the Pvalue back to the main table
Names Default To Here( 1 );
Clear Log();
try(data Table( "one sample t-test validation Anonymized")<<CLOSE window=""> |t|", "Prob > t", "Prob < t"} )
);
variable = column(dt,3)<<GET values=""></GET></CLOSE>