Is the "max" argument to the "ylim" function


#1

always the sqrt( ) of the smallest sample_size value ?


#2

# The vector `p` contains 100 proportions of Democrats ranging from 0 to 1 using the `seq` function
p <- seq(0, 1, length = 100)

# The vector `sample_sizes` contains the three sample sizes
sample_sizes <- c(25, 100, 1000)

# Write a for-loop that calculates the standard error `se` for every value of `p` for each of the three samples sizes `N` in the vector `sample_sizes`. Plot the three graphs, using the `ylim` argument to standardize the y-axis across all three plots.

for(i in sample_sizes){
  
  se <- sqrt(p * (1 - p) / sample_sizes) 
  
  plot(x = p, y = se, ylim = c(0, sqrt(25))) 
}
#> Warning in p * (1 - p)/sample_sizes: longer object length is not a multiple
#> of shorter object length

#> Warning in p * (1 - p)/sample_sizes: longer object length is not a multiple
#> of shorter object length

#> Warning in p * (1 - p)/sample_sizes: longer object length is not a multiple
#> of shorter object length