title: How do I conduct a One-Sample Chi-Squared Test On Population Variance in R?
body: <p>First of all, I'm aware that I can use var.test(x, y) for inference on the ratio of two population variances, but my question is regarding inference on one population variance.</p>
  <p>According to this <a href="https://www.rdocumentation.org/packages/EnvStats/versions/2.3.1/topics/varTest#:%7E:text=The%20function%20varTest%20performs%20the,The%20R%20function%20var." rel="nofollow noreferrer">source</a>, I should use the function varTest() to conduct a one-sample test on population variance. However, I get an error code whenever I try this, as R could not find this function:</p>
  <pre><code>x &lt;- rnorm(50, mean = 4, sd = 1)
  varTest(x, sigma.squared = 1) # sigma.squared is our null hypothesis for population variance
  Error in varTest(x, sigma.squared = 1) : 
    could not find function &quot;varTest&quot;
  </code></pre>
  <p>This is what happens if I try to use var.test() for a one sample test on population variance:</p>
  <pre><code>x &lt;- rnorm(50, mean = 4, sd = 1)
  var.test(x, sigma.squared = 1)
  Error in var.test.default(x, sigma.squared = 1) : 
    argument &quot;y&quot; is missing, with no default
  </code></pre>
  <p>No surprise for the second error as I think var.test() is reserved only for inference on the ratio of two population variances.</p>
  <p>Is it the case that I'm supposed to use the function varTest, but I simply don't have the package which contains that function installed?</p>
  <p>Background Information:
  I'm running RStudio Version 1.3.959 on macOS Catalina Version 10.15.6
  This is a <a href="https://www.youtube.com/watch?v=lyd4V8DFCjM&amp;t=662s" rel="nofollow noreferrer">video</a> of the statistical test that I'm trying to conduct in R.</p>