Data points decreased

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

Is some of your data negative?

No.
The original doesn’t contain negative data


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)

i.e. it is giving you metadata rather than data

1 Like

if i want to fit a model with this data
is it enough to fit the model?

Why dont you try and see ?

i have already tried it and the model is working but i want to make sure from someone tried the same process

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.