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

Hi! I am new to R-studio. Does anyone know the code (if there is one) for finding mean and sd of a variable eg. distance river(m) for a species variable (precence/absence)? Hope my question contains sufficient amounts of information.

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

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.