dear posit community members,

Currently I'm working on modelling a specific data using Maximum Likelihood but the data must fulfil REML assumptions, one of the assumption is the normality assumption, i used box cox transformation to normalize the data but I noticed that original contains 539 observation but after the transformation is reduced to 100 observation only; it is my first time to face such a problem.

If any one faced a problem like this please tell me how it could be solved.

this is the code

#original data

original_data<- read_excel("C:data.xlsx")

summary(original_data)

hist(original_data$X1)

hist(original_data$Y)

plot(Y~X1,data = original_data)

#box cox transformation

fullmodel<- lm(Y~X1, data = original_data)

plot(fullmodel)

summary(fullmodel); abline(fullmodel)

#Apply box cox transformation

transfomed_bxcx<- boxcox(fullmodel, lambda =seq (-5,5))

view(transfomed_bxcx)

summary(transfomed_bxcx)

Thanks in advance