Independence Assumption for T-Test I know this is pretty basic, but had a question about the independence assumption when it came to the t-test. I understand that we want our observations in each group to be independent of one another as it can skew our data. What if we were specifically trying to find if there was a difference in means between two specific people or groups?
For example, suppose we had two basketball players, A and B, and we wanted to see if there was a difference in mean points scored between the two.
playerA<- round(rnorm(50, mean=23, sd=4), 0)
playerB<- round(rnorm(50, mean=14, sd=6), 0)
t.test(playerA, playerB, var.equal = T)

Would this violate the independence assumption? Although each observation of points scored isn't influenced by games played before, it is coming from the same player.
 A: There is nothing in your scenario that suggests that the two samples aren't independent.  By necessity, the two groups in a t-test have to be grouped in some way, otherwise you wouldn't know that they are groups.
There are different ways that the data in your scenario could be not independent. One example is if each observation is the score for a game, and the two players are on the same team, then their scores might be paired because against a difficult team they might both score poorly, and against a weak team they might both score well.  A slightly different form of lack of independence would be if one player's score causally affected the other's.  Like if one player was betting on the games, and then would play differently, based on the the other player's scoring, in order to make the final score be in accord with her bets.  A different issue is auto-correlation within each player's scores. For example, if the player really does have a "hot streak" where scoring well in one game increases the probability of scoring well in the next game.
A: Yes, this violates the independence assumption, which is probably the worst assumption to violate (t tests can be robust to other violations). The problem is the observations within each player are correlated. 
I'll assume you have two players, each playing 50 games, and you want to know if one is statistically 'better'. 
I can't be sure without knowing more, but this feels like it might be accomplished with the nonparameteic sign test, which quantifies the extent to which paired observations tend to favor one or the other player. 
