0
I have been trying to adjust the distributions and lognormal in the data and have been facing the following error:
--should not have NA or Nan values--.
Dice: https://drive.google.com/file/d/12fc38jWMFiAME3ImgED2I-nt69jJHfrh/view?usp=sharing
Follow below the codes:
rm(list = ls())
library(readxl)
library(survival)
library(muhaz)
library(fitdistrplus)
setwd("C:\\Users\\breni\\Google Drive\\Acadêmica\\Mestrado\\TrabalhosSubmetidos\\SubmissãoWASA\\CoxEstratificado")
dados = readxl::read_excel('dados1.xlsx')
dados$Estagio = dados$Extensão
dados$Estagio[dados$Extensão=='SEM INFORMAÇÃO'] <- NA
dados$Estagio[dados$Extensão=='IN SITU'] <- NA
dados$Grau.de.Instrução[dados$Grau.de.Instrução=='FUNDAMENTAL'] <- 'ENSINO FUNDAMENTAL'
dados <- data.frame(dados)
head(dados)
attach(dados)
x11()
hist(dados$tempo_vida_meses)
####################################
cbind(table(Estado.Civil),prop.table(table(Estado.Civil))*100)
cbind(table(Raca.Cor),prop.table(table(Raca.Cor))*100)
cbind(table(Grau.de.Instrução),prop.table(table(Grau.de.Instrução))*100)
######################################################################
Weibdist = fitdist(dados$tempo_vida_meses, "weibull")
Expdist = fitdist(dados$tempo_vida_meses, "exp")
lgnormdist = fitdist(dados$tempo_vida_meses, "lnorm")
Excellent answer. But here comes a theoretical discussion: if these data are sampled and 0 is a possible result for them, should Weibull or log-normal distributions be an option for their modeling? In my opinion no. Perhaps it was necessary to look for another probability distribution, such as the zero inflated Weibull.
– Marcus Nunes
Reinforcing the observation of Marcus Nunes: the answer was great to identify the cause of the problem; but Breno, if the probability function he is using does not accept zeros and the data have zeros, look for a more appropriate one. The model should be adjusted to the data, never the other way around.
– Carlos Eduardo Lagosta