Find mean and sd of 0/1 variable belonging to a numerical variable

Hi @slettengmats,
Welcome to RStudio! To help us answer your question, could you post some sample data in "reproducible example" format? Here's an article that explains how to do this:

Even if your actual data is hard to include, confidential, etc., it would be really helpful if you could post just a few lines of a fake dataset so that we can help figure out the answer to your question.

Thanks!

1 Like