I've elaborated 3 code scripts in R which are described like that:
Script I: I've imported a dataset from National Institute of Statistics and Informatics from Peru where I've gotten referencials parameters by each stratum to after simulate a population with structure of linear regression model.
Script II: I've simulated a normal multivariate population with the parameters obtained in five strates (The Mardia's Test has been done for each stratum)
Script III: Once that I've already simulated the population, I extract the samples from 2 ways. At first, I've extracted a sample with a complex design (setting the sample complex design) while on other hand I've extracted a simple random sampling. The idea is that I have to make the Wald Test and LRT Test for both samples, contrasting the parameters with the population was obtained.
So, Having a parameter vector to contrast called coeficientesfinal. 1) After to declare my design when I am doing the function "regTermTest"
regTermTest(reg_compleja_diseno,~IngresoHogar+MiembrosHogar+NivelInstruccion, null= coeficientesfinal[c(1,3,5)], method=c("Wald"), lrt.approximation="saddlepoint")
regTermTest(reg_compleja_diseno,~IngresoHogar+MiembrosHogar+NivelInstruccion, null= coeficientesfinal[c(1,3,5)], method=c("LRT"), lrt.approximation="saddlepoint")
The first part, the Wald Test results logical but the second (for LRT) results the opposite. ****So, Could be I using in the incorrect way the function??****
******2) To replicate the same tests but for the simple random sampling, What functions should I use?** i.e Wald Test and LRT Test.****
Aucun commentaire:
Enregistrer un commentaire