anestistouloumis / simcormultres Goto Github PK
View Code? Open in Web Editor NEWSimulates correlated multinomial responses conditional on a marginal model specification.
Home Page: https://CRAN.R-project.org/package=SimCorMultRes
Simulates correlated multinomial responses conditional on a marginal model specification.
Home Page: https://CRAN.R-project.org/package=SimCorMultRes
I've noticed that the correlation estimate from fitting a GEE model (package gee) is consistently smaller than the true correlation parameter I enter in the rbin statement. In the example below, my true rho = 0.5 (exchangeable correlation structure) but the estimated rho in GEE is 0.2999. I've conducted a small simulation (n = 1000) and the estimated rho is consistently smaller. Fixed effects seem asymptotically unbiased. I would like to obtain unbiased correlation estimates as well as unbiased fixed effects. Please advise.
library(SimCorMultRes)
library(gee)
N <- 100
x <- rbinom(N, 1, prob = 0.5)
xvec <- rep(x, each = 3)
intercepts <- -1
betas <- 0.5
clsize <- 3
rho <- 0.5
cor.matrix <- matrix(ncol = 3, nrow = 3,
c(1, rho, rho,
rho, 1, rho,
rho, rho, 1))
CorBinRes <- rbin(clsize = clsize, intercepts = intercepts, betas = betas,
xformula = ~xvec, cor.matrix = cor.matrix, link = "logit")
binGEEmod <- gee(y ~ xvec, family = binomial("logit"), id = id,
corstr = "exchangeable",
data = CorBinRes$simdata)
summary(binGEEmod)
summary(binGEEmod)
GEE: GENERALIZED LINEAR MODELS FOR DEPENDENT DATA
gee S-function, version 4.13 modified 98/01/27 (1998)
Model:
Link: Logit
Variance to Mean Relation: Binomial
Correlation Structure: Exchangeable
Call:
gee(formula = y ~ xvec, id = id, data = CorBinRes$simdata, family = binomial("logit"),
corstr = "exchangeable")
Summary of Residuals:
Min 1Q Median 3Q Max
-0.4184397 -0.4184397 -0.3270440 0.5815603 0.6729560
Coefficients:
Estimate Naive S.E. Naive z Robust S.E. Robust z
(Intercept) -0.7215851 0.2145247 -3.363646 0.2303582 -3.132448
xvec 0.3924033 0.3048868 1.287046 0.3020483 1.299141
Estimated Scale Parameter: 1.006711
Number of Iterations: 1
Working Correlation
[,1] [,2] [,3]
[1,] 1.000000 0.299852 0.299852
[2,] 0.299852 1.000000 0.299852
[3,] 0.299852 0.299852 1.000000
Great package, thank you, may you share links to similar software to compare performance of your package with other packages
Even if another software is written in another computer language
Thanks a lot in advance
Anestis
great code thank
seems only you managed to have such a package for several last years
only
can you share example how to generate for example for 5 variables
when each variable has 3 or 7 values
and some how correlation ( dependency, similarity) between each value pairs are given
for example for 2 values for 3 variables
variable 1 : green 30%, red 70%
variable 2 : big 40%, small 60%
variable 3 : table 10%, car 90%
Corrections are:
green big - 0.3
green small - 0.1
green table - 0.2
green car - 0.8
red big - 0.7
red small - 0.6
red table - 0.5
red car - 0.2
big table - 0.3
big car - 0.2
small table - 0.3
small car - 0.2
it it correctly set problem for your package?
Thank you very much in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.