###### Regression for non-negative data (BC trans.)
ng1 <-nongauss_y( y_nonneg = TRUE )
ng1
###### General non-Gaussian regression for continuous data (two SAL trans.)
ng2 <-nongauss_y( tr_num = 2 )
ng2
###### General non-Gaussian regression for non-negative continuous data
ng3 <-nongauss_y( y_nonneg = TRUE, tr_num = 5 )
ng3
###### Over-dispersed Poisson regression for count data
ng4 <-nongauss_y( y_type = "count" )
ng4
###### A general non-Gaussian regression for count data
ng5 <-nongauss_y( y_type = "count", tr_num = 5 )
ng5
############################## Fitting example
require(spdep);require(Matrix)
data(boston)
y <- boston.c[, "CMEDV" ]
x <- boston.c[,c("CRIM","ZN","INDUS", "CHAS", "NOX","RM", "AGE",
"DIS" ,"RAD", "TAX", "PTRATIO", "B", "LSTAT")]
xgroup<- boston.c[,"TOWN"]
coords<- boston.c[,c("LON","LAT")]
meig <- meigen(coords=coords)
res <- resf(y = y, x = x, meig = meig,nongauss=ng2)
res # Estimation results
plot(res$pdf,type="l") # Estimated probability density function
res$skew_kurt # Skew and kurtosis of the estimated PDF
res$pred_quantile[1:2,]# predicted value by quantile
coef_marginal(res) # Estimated marginal effects (dy/dx)
Run the code above in your browser using DataLab