title: I am trying to compare results of normal distribution with t distribution for unknown df value
body: <p>I have to compare results of a normal quantile (.975 for eg) with various df values in t distributions till it gives same results as the normal distribution's same quantile. 
  eg; find minimum df value for .975 quantile of t distribution to result in same value as .975 quantile of normal distribution upto 2 decimal places.(don't necessarily need r code for this, although it would help for next part of assignment.)</p>
  
  <p>need an r code that can do the same as above but with any quantile and any number of decimal places. </p>
  
  <p>I tried tackling with the .975 version first but with no luck, a and b are variables with qnorm and qt results:</p>
  
  <pre><code>a &lt;- round(qnorm(.975,0,1),2)
  a
  
  df &lt;- c(1:1000)
  b &lt;- round(qt(.975,df),2)
  b
  
  for (i in 1:length(df)) {
      if (round(qt(.975,df[i]),2)==round(qnorm(.975,0,1),2)) {
      df[i]
      }
  }
  </code></pre>
  
  <p>Tried it in as simple as if a==b, then return df value for i, and got error the condition has length >1 and only the first element will be used, the above code on the other hand doens;t give any errors or result.</p>