こんにちは、
人口統計学的重み付けと人口層およびPSUを組み込んだNHANESデータを見て、JMPで調査設計を行う方法はありますか? 以下のCDCから添付されているSASコードと、R&Stataコードがあります。
https://wwwn.cdc.gov/nchs/nhanes/tutorials/Module4.aspx
コード:
SAS
PROC SURVEYMEANS data=one varmethod=taylor nomcar;
STRATA sdmvstra;
CLUSTER sdmvpsu;
WEIGHT WTMEC4YR;
DOMAIN Select;
* more statements...;
run;
理想的には、これを実行して、JMPで非常によく見られる表形式の関数を実行できるようにすることができます。
JMP / JSLだけでこれを実行できるかどうかはわかりませんが、JMPを使用すると、Rコードを実行するのが非常に便利になります。
私はこれをテストしていませんが、Rをインストールした後、コードは次のようになります。
Names default to here(1);
//Open R
R Init();
//Open your data table here:
dt = Current data table();
//send data to R
R Send(dt);
//run your code
R Submit( "\[
# install package if needed, really only needs to happen once
if (!("survey" %in% installed.packages())) install.packages("survey")
#load package
library(survey)
#code from the website, you will want to verify column names here
NHANES_all <- svydesign(data=dt, id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC4YR, nest=TRUE)
NHANES <- subset(NHANES_all, inAnalysis==1)
m <- svymean(~Depression, NHANES)
]\" );
//return data from R
svymean = R Get( m )
//Close R
R Term();RとJMPの統合に関する詳細:
https://www.jmp.com/en_au/events/ondemand/mastering-jmp/jmp-and-r-integration.html
https://community.jmp.com/t5/JMPer-Cable/Getting-started-with-the-JMP-to-R-Interface/ba-p/43920
そして、ここに彼らが使用するRパッケージに関するいくつかの情報があります:
https://cran.r-project.org/web/packages/survey/survey.pdf