p value for two sets having variable x and y
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello all. I have a question about statistics. I have two sets of data. each set of data has an x and a y value (in more details, for each concentration "x" a surface charge "y" is measured experimentally. and this was done for two different membranes in the experiment). SO: I have a set of x and y for system 1 and a set of x and y for system 2.
My question is: how can make sure that these two sets are significantly different?
I am familiar with the t-test and getting the value of p. how does that work when "x" is not the same for the two sets of data??
Happy to elaborate further if this is not clear and thank you in advance.
댓글 수: 0
답변 (2개)
Star Strider
2021년 8월 25일
The most appropriate measure might be the ranksum test if the experiments are unpaired (for example an intervention and control group), and signrank if paired (the same group before and after an intervention).
The advantage of these is that the groups have to have the same distribution, however that distribution may be unknown.
There may be other options as well, however on the basis of the information provided, these would seem to be appropriate.
.
댓글 수: 3
Star Strider
2021년 8월 25일
I am not certain what the problem is.
Perhaps sharing the data would help.
.
Scott MacKenzie
2021년 9월 24일
편집: Scott MacKenzie
2021년 9월 24일
Since for each system, y is the measured response for x, you can reduce the data for that set to x-y. Also, since the systems use different membranes, the data sets are independent or unpaired. Depending on the assumptions for the underlying data you can use either ttest2, the parametric two-sample t-test, or ranksum, the non-parametric test for unpaired data. Generally, these two tests give the same or similar results. Since the samples are independent, there is no need to have the same number of measurements in each set. Here's an example:
% 10 measurements for system 1
x1 = rand(10,1);
y1 = rand(10,1);
set1 = x1-y1;
% 12 measurements for system 2
x2 = rand(12,1);
y2 = rand(12,1);
set2 = x2-y2;
% parametric test for equal means and variances
[~, p1] = ttest2(set1, set2)
% non-parametric test for equal medians
p2 = ranksum(set1, set2)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Hypothesis Tests에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!