# Sample Size problem: Have done a trial/pilot, but how to proceed?

#### lotw

##### New Member
I have a problem in calculating sample size. I did do a small pilot experiment, so this is some sample data with the same structure:
Code:
df <- data.frame(ID = c(1,2,3,4,5,6,7,8,9),
School = c("A","A","A","B","B","B","C","C","C"),
Test_Method_A = c("1A","2A","3A","1A","2A","3A","1A","2A","3A"),
SchoolSystemA_Score = c(80,75,25,87,65,15,66,90,65),
Test_Method_B = c("1B","2B","3B","1B","2B","3B","1B","2B","3B"),
SchoolSystemB_Score = c(78,56,80,58,65,98,79,55,70))
df
ID School Test_Method_A SchoolSystemA_Score Test_Method_B SchoolSystemB_Score
1  1      A            1A                  80            1B                  78
2  2      A            2A                  75            2B                  56
3  3      A            3A                  25            3B                  80
4  4      B            1A                  87            1B                  58
5  5      B            2A                  65            2B                  65
6  6      B            3A                  15            3B                  98
7  7      C            1A                  66            1B                  79
8  8      C            2A                  90            2B                  55
9  9      C            3A                  65            3B                  70
The idea is this: I'm trying to compare 2 school systems. Based on different factors I have paired schools together. So for ID=1 you have 2 schools with either a school method A or school method B. 3 different types of measuring were done for each School. And because a school with method A requires different testing methods than a school with system B, I end up with 6 different measuring types. For each measurement account: a class is tested and the average score (in %) is used. In the end, I want to know which method gives higher grades, and the outcome should say something for all schools (with the same methods of course, compared to each other) in the USA

But to make a proposal I need to give an indication for the sample size, and I am very unsure about how to calculate this. So what I think I should at least know is the variance of the SchoolSystemA_Score and SchoolSystemB_Score, and the effect size I would at least want to know is 5%.

I'm just not really sure how I should split the groups (or shouldn't)

and what way to do this, is
Code:
pwr.t.test(d=d, sig.level=.05, power = .90, type = 'two.sample')
a good way to go?

Sorry this might be very obvious for many, but I've tried to find articles/literature on this but I get very stuck. mostly because I can;t seem to translate it to my dataset.. Could anyone help me with this, very much appreciated!

#### lotw

##### New Member
Small additional explanation in another example:

Let's change it to medicins: You have a Person (=Variable School) with 3 different tests (=variable Test_Method) he/she is tested for blood sugar before taking the medicine that gives a score for every different test (= variable SchoolSystemA_Score). Then, the same person takes a medicine that should influence blood sugar level. Because of the type of medicine, the blood sugar after the medicine can only be measured with different types of tests, so you get 3 new test methods (=variable Test_Method_B) and this again gives 3 different scores (SchoolSystemB_Score). Hope this gives a better idea of my data..! The only difference here is that, now I talk about person but actually what I have are groups of people that do 3 tests and for each test only 1 % outcome