Hola,
Al observar los datos de NHANES que incorporan ponderaciones demográficas y estrato de población y PSU, ¿hay alguna manera de hacer un diseño de encuesta en JMP? Hay un código SAS adjunto del CDC a continuación, así como un código R & Stata.
https://wwwn.cdc.gov/nchs/nhanes/tutorials/Module4.aspx
Código:
SAS
PROC SURVEYMEANS data=one varmethod=taylor nomcar;
STRATA sdmvstra;
CLUSTER sdmvpsu;
WEIGHT WTMEC4YR;
DOMAIN Select;
* more statements...;
run;
Idealmente, puedo hacer esto para poder ejecutar la función de tabulación, que me gusta mucho en JMP.
No estoy seguro de si puede hacer esto solo en JMP / JSL, pero JMP hace que sea tan conveniente ejecutar el código R que me pregunto si vale la pena reinventar la rueda aquí.
No lo he probado, pero después de instalar R, su código se vería así:
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();Más información sobre la integración de R con 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
Y aquí hay información sobre el paquete R que usan:
https://cran.r-project.org/web/packages/survey/survey.pdf