I want to perform a two-sample T-test to test for a difference between two independent samples which each sample abides by the assumptions of the T-test (each distribution can be assumed to be independent and identically distributed as Normal with equal variance). The only complication from the basic two-sample T-test is that the data is weighted. I am using weighted means and standard deviations, but weighted N's will artificially inflate the size of the sample, hence bias the result. Is it simply a case of replacing the weighted Ns with the unweighted Ns?

  • $\begingroup$ What is N? What is the nature of the weighting scheme? Are the weights known? $\endgroup$
    – user28
    Aug 4, 2010 at 1:25
  • $\begingroup$ see also this related question: stats.stackexchange.com/questions/856/… $\endgroup$
    – Henrik
    Aug 4, 2010 at 11:22
  • $\begingroup$ If you use R, try weights::wtd.t.test or sjstats::survey_median. The second package also has weighted chi-square and mann whitney. $\endgroup$ Dec 21, 2023 at 12:51

1 Answer 1


Use regression methods. A simple linear regression with group coded as 0-1 (or 1-2, etc) is equivalent to a t-test, but regression software usually has the capability to incorporate weigths correctly.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.