Sunday, 15 September 2013

Box-Cox transformation with survey data in R -



Box-Cox transformation with survey data in R -

does know of way estimate box-cox multivariate transformations survey info in r? i'm not aware of takes business relationship strata , clusters (the info i'm working with), takes business relationship probability weights great.i'm worried fact distribution of 1 or more variables may alter when probability weights applied, transformation may alter radically. there may implications errors , box-cox algorithm etc... beyond theory-confirmation approach.

updated question

the r function powertransform works great, don't think there's yet survey data. thought stata handle nick pointed out not case. box-cox transformation handles sampling weights seems this.

are aware of r function allows apply both univariate , multivariate boxcox transformations probability weighted data?

i don't have info wondering if had found solution this. know people appreciate when specific illustration given so...

univariate box-cox: results returned univariate box-cox when using lm , svyglm (survey package) objects.

library(survey) data(api) library(car) dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc) sur<-svyglm(api00~mobility, design=dstrat) notsur<-lm(api00~mobility, data=apistrat) powertransform(sur) powertransform(notsur)

however don't think powertransformation survey object right because same results notsur (and different sur) when run

none<-svydesign(id=~1, weights=rep(1,nrow(apistrat)), data=apistrat, ) sur2<-svyglm(api00~mobility, design=none) powertransform(sur2)

i'm less sure how find multivariate normality you'd have utilize actual info e.g.

summary(powertransform(cbind(api00,mobility)~1,apistrat))

the link have given appears to user-defined function in sas running within info step. should possible reprogram method r.

if @ suggested sas method here, you'll see uses proc transreg estimate powerfulness transformation required. sas proc not take survey weights. not sure weight alternative in proc see here

update: had closer @ first link gave here. appears weighting beingness done in proc univariate weight alternative activated if info contains weights. however, if @ detail weight here, you'll see weights used manipulate variances. i'm not sure want run assumption data.

r survey stata

No comments:

Post a Comment