Description Usage Format Source Examples
Wage rates of 753 married white women with left censoring.
1 |
A data frame with 753 observed wage rates of married white women in 1975. Some wage rates are set equal to zero, this means that those wives did not work in 1975, therefore, these observations are considered left censored at zero.
=1 if in labor force, 1975
hours worked, 1975
# kids < 6 years
# kids 6-18
woman's age in yrs
years of schooling
estimated wage from earns., hours
husband's years of schooling
family income, 1975
mother's years of schooling
father's years of schooling
unem. rate in county of resid.
=1 if live in SMSA
actual labor mkt exper
(faminc - wage*hours)/1000
exper^2
Mroz, T.A. 1987. "The sensitivity of an empirical model of married women's hours of work to economic and statistical assumptions".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #Load the data
data(wage.rates)
#Set the response y and covariate x
y <- wage.rates$wage
x1 <- cbind(1,wage.rates$age,wage.rates$educ,wage.rates$hours/1000)
cc <- c(rep(0,428),rep(1,325))
########################################################################
#Example for regression modelling of censored data based on
#Mixtures of Scale Mixtures of Normal (SMN) distributions
########################################################################
#Obtain the initial values
initial <- initial.values.fm.smn.cr(cc, y,x1,g=2,algorithm="k-means"
,family="T",lower=1,upper=20,space=1,plotLog = TRUE,searchNU=TRUE,
printNU=FALSE, saveFigure = FALSE)
##Fits a left mixture censored Student-t model to the data
fitT <- fm.smn.cr(cc, y, x1, Abetas = initial$Abetas, medj = initial$medj
, sigma2 = initial$sigma2, pii = initial$pii, nu=initial$nu, g = 2,
family = "T", error = 0.0001, iter.max = 500)
##Fits a left mixture censored Normal model to the data
fitN <- fm.smn.cr(cc, y, x1, Abetas = initial$Abetas, medj = initial$medj
, sigma2 = initial$sigma2, pii = initial$pii, nu=initial$nu, g = 2,
family = "Normal", error = 0.0001, iter.max = 500)
######################################################################
#Example for finite mixture of regression models for censored data
#based on scale mixtures of modelling of censored data based on
#Mixtures of SMN distributions
######################################################################
#Obtain the initial values
initial <- initial.values.fmr.smn.cr(cc, y,x1,g=2,algorithm="k-means"
,family="T",lower=1,upper=20,space=1,plotLog = TRUE,searchNU=TRUE,
printNU=FALSE, saveFigure = FALSE)
##Fits a left mixture censored Student-t model to the data
fitT <- fmr.smn.cr( cc, y, x1, Abetas = initial$Abetas,
sigma2 = initial$sigma2, pii = initial$pii, nu=initial$nu,
g = 2, family = "T", error = 10^-4, iter.max = 500)
##Fits a left mixture censored Normal model to the data
fitN <- fmr.smn.cr(cc, y, x1, Abetas = initial$Abetas,
sigma2 = initial$sigma2, pii = initial$pii, nu=initial$nu,
g = 2, family = "Normal", error = 10^-4, iter.max = 500)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.