Re: [R] R code for overlapping variables -- count

2024-06-03 Thread Ebert,Timothy Aaron
dalgaard Sent: Monday, June 3, 2024 5:02 AM To: Shadee Ashtari Cc: r-help@r-project.org Subject: Re: [R] R code for overlapping variables -- count [External Email] If they are binary (0/1 dummies), can't you just "&" them as in table(Female & USA & MidIncome) (or sum()

Re: [R] R code for overlapping variables -- count

2024-06-03 Thread peter dalgaard
If they are binary (0/1 dummies), can't you just "&" them as in table(Female & USA & MidIncome) (or sum() if you don't care about the number of 0s) -pd > On 2 Jun 2024, at 00:31 , Shadee Ashtari wrote: > > Hi! > > I am trying to find the code for how to get counts for intersectional > varia

Re: [R] R code for overlapping variables -- count

2024-06-02 Thread Rui Barradas
Às 18:40 de 02/06/2024, Rui Barradas escreveu: Às 18:34 de 02/06/2024, Leo Mada via R-help escreveu: Dear Shadee, If you have a data.frame with the following columns: n = 100; # population size x = data.frame(   Sex = sample(c("M","F"), n, T),   Country = sample(c("AA", "BB", "US"), n,

Re: [R] R code for overlapping variables -- count

2024-06-02 Thread Leo Mada via R-help
Correcting a small glitch - see new code. From: Leo Mada Sent: Sunday, June 2, 2024 8:34 PM To: Shadee Ashtari Cc: r-help@r-project.org Subject: [R] R code for overlapping variables -- count Dear Shadee, If you have a data.frame with the following columns: n

Re: [R] R code for overlapping variables -- count

2024-06-02 Thread Rui Barradas
Às 18:34 de 02/06/2024, Leo Mada via R-help escreveu: Dear Shadee, If you have a data.frame with the following columns: n = 100; # population size x = data.frame(   Sex = sample(c("M","F"), n, T),   Country = sample(c("AA", "BB", "US"), n, T),   Income = as.factor(sample(1:3, n, T)

[R] R code for overlapping variables -- count

2024-06-02 Thread Leo Mada via R-help
Dear Shadee, If you have a data.frame with the following columns: n = 100; # population size x = data.frame(   Sex = sample(c("M","F"), n, T),   Country = sample(c("AA", "BB", "US"), n, T),   Income = as.factor(sample(1:3, n, T)) ) # Dummy variable ONE = rep(1, nrow(x)) r = aggrega

Re: [R] R code for overlapping variables -- count

2024-06-02 Thread Duncan Murdoch
On 2024-06-01 6:31 p.m., Shadee Ashtari wrote: Hi! I am trying to find the code for how to get counts for intersectional variables. For example, I have three unique categorical variables -- "Female," "USA," and "MidIncome" -- and I'm trying to see how many people I have at the intersection of th

[R] R code for overlapping variables -- count

2024-06-02 Thread Shadee Ashtari
Hi! I am trying to find the code for how to get counts for intersectional variables. For example, I have three unique categorical variables -- "Female," "USA," and "MidIncome" -- and I'm trying to see how many people I have at the intersection of the three. Thank you so much, Shadee [[al