# How to estimate $P(x\le0)$ from $n$ samples of $x$?

Suppose, we have $$n$$ samples $$x_i$$ of a random variable:
$$x \sim \mathcal N(\mu,\sigma^2)$$

Based on the samples, we want to estimate the probability that $$x$$ is negative:
$$P(x\le0)$$

Intuitively, I would first estimate:
$$\hat \mu=\frac 1 n \sum x_i$$
$$\hat \sigma^2={\frac 1 {n-1} \sum (x_i-\hat \mu)^2}$$

and then calculate:

$$P(x\le0)=\frac1{\sqrt{2\pi\hat\sigma^2}} \int_{-\infty}^0 e^\frac{x-\hat\mu}{\hat \sigma} dx$$

However $$\hat \mu$$ and $$\hat \sigma$$ have variance! If I use this method, I suspect I am ignoring that variance and making an incorrect estimation.

Is this reasoning right?

If so, how can I estimate $$P(x\le0)$$ more correctly, taking $$\text {VAR}[\hat \mu]$$ and $$\text {VAR}[\hat \sigma]$$ into account?

$$\widehat{\mathbb{P}(X \leqslant 0)} = \frac{1}{n} \sum_{i=1}^n \mathbb{I}(x_i \leqslant 0).$$