How to find the conditional CDF based on observed data in R If we have two samples (generally their distribution is not known),say $X\sim N(0,1)$, $Y|X\sim N(X,X^2/2)$. Can we recover the conditional CDF of $Y|X$ based on the observed samples in R?
n=1000
x=rnorm(n)
y=rnorm(n,x,x^2/2)

 A: You can't determine the CDF from samples, but you can easily get an empirical estimate:
set.seed(1359)
n <- 1000
x <- rnorm(n)
y <- rnorm(n, x, x^2/2)

LM <- lm(y ~ 0 + x) # no intercept because you know this, though usually you won't
coef(LM)

Gives me $\hat{\beta} = 1.076$, or $\hat{y} = 1.076 \cdot x + \epsilon$ (about $1\times x$, as you specified).
Similarly, you can get an empirical estimate of the standard deviation you supplied with sd(resid(LM)).

If you don't know anything about their distributions, you could try a non-parametric approach. 
A: Finding the conditional distribution of a variable $Y$ conditional on another observed variable $X$ is the entire subject matter of regression analysis (construed in its wide sense to include linear and nonlinear regression models, GLMs, GLMMs, etc.).  This is a huge subject and a core part of statistical education.  If you would like to learn more about it, I would recommend starting with some material on linear regression analysis, and then building up from there.
