title: How do I find the correlation and the covariance matrix from a data with a dummy variable?
body: <p>I have a dataset that has the column names Gender, IQ, and Brain_Mass. Only Gender is a categorical variable of course, so I assigned it a dummy variable by setting it as <code>gender=factor(Gender)</code>. </p>
  
  <p>However, I want to find the covariance matrix and the correlation matrix. I know that I can just use the <code>cov2cor(V)</code> to get the correlation matrix, but how do I get the covariance matrix from this data? I don't think I can just take the <code>var(data)</code> since a dummy variable exists.. </p>
  
  <p>I would really appreciate it if anyone could help out. Thanks.</p>