I have observed data $y$. And I have a function that gives me estimated $\hat{y} = f(x,\hat{P})$ where P is the parameter I want to estimate. I was able to optim() command in R to get maximized log-likelihood estimate $\hat{P}$ using the residuals, assuming a normal distribution.
My question is: If I have multiple dataset and all of them should have the same $P$ but x is on a different scale for each dataset. Now I want to maximize the overall log-likelihood to find the overall $\hat{P}$ and its standard error. Can I just simply compute all the residuals from each data and assume they all have the same distribution so that I can use optim() to maximize the log-likelihood of that?