Ciao,
Esaminando i dati NHANES che incorporano ponderazioni demografiche, strato di popolazione e PSU, esiste un modo per progettare un sondaggio in JMP? C'è un codice SAS allegato dal CDC di seguito così come il codice R & Stata.
https://wwwn.cdc.gov/nchs/nhanes/tutorials/Module4.aspx
Codice:
SAS
PROC SURVEYMEANS data=one varmethod=taylor nomcar;
STRATA sdmvstra;
CLUSTER sdmvpsu;
WEIGHT WTMEC4YR;
DOMAIN Select;
* more statements...;
run;
Idealmente, posso farlo in modo da poter eseguire la funzione di tabulazione, che mi piace molto in JMP.
Non sono sicuro che sia possibile farlo solo in JMP / JSL, ma JMP rende così conveniente eseguire il codice R che mi chiedo se valga la pena reinventare la ruota qui.
Non l'ho testato, ma dopo aver installato R il tuo codice sarebbe simile a questo:
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();Maggiori informazioni sull'integrazione di 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
Ed ecco alcune informazioni sul pacchetto R che usano:
https://cran.r-project.org/web/packages/survey/survey.pdf