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
boxcox {MASS} R Documentation
Box-Cox Transformations for Linear Models
Description
Computes and optionally plots profile log-likelihoods for the parameter of the Box-Cox power transformation.
This function gives you a range of lambda values (shows you 100 of them ) and the corresponding log-likelihoods, it does not choose one of those 100 lambda values and transform that data for you (or if it does so internally , it doesnt share that with you)