<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Taylor Series Linearization to Calculate Variance in NHANES in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Taylor-Series-Linearization-to-Calculate-Variance-in-NHANES/m-p/337234#M58472</link>
    <description>&lt;P&gt;I am not sure whether you can do this in just JMP/JSL, but JMP makes it so convenient to run R code I wonder if it is worth reinventing the wheel here. You could let R do the analysis and then bring results back into JMP to use tabulate/graph builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've not tested this, but after installing R your code would look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;- svydesign(data=dt, id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC4YR, nest=TRUE)                    
	NHANES &amp;lt;- subset(NHANES_all, inAnalysis==1)
	m &amp;lt;- svymean(~Depression, NHANES)
	
]\" );

//return data from R
svymean = R Get( m )

//Close R
R Term();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;More info on integrating R with JMP:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.jmp.com/en_au/events/ondemand/mastering-jmp/jmp-and-r-integration.html" target="_blank" rel="noopener"&gt;https://www.jmp.com/en_au/events/ondemand/mastering-jmp/jmp-and-r-integration.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMPer-Cable/Getting-started-with-the-JMP-to-R-Interface/ba-p/43920" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/JMPer-Cable/Getting-started-with-the-JMP-to-R-Interface/ba-p/43920&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is some info on the R package they use:&lt;/P&gt;&lt;P&gt;&lt;A href="https://cran.r-project.org/web/packages/survey/survey.pdf" target="_blank" rel="noopener"&gt;https://cran.r-project.org/web/packages/survey/survey.pdf&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Nov 2020 22:46:11 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2020-11-24T22:46:11Z</dc:date>
    <item>
      <title>Taylor Series Linearization to Calculate Variance in NHANES</title>
      <link>https://community.jmp.com/t5/Discussions/Taylor-Series-Linearization-to-Calculate-Variance-in-NHANES/m-p/336913#M58435</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Looking at the NHANES data that incorporates demographic weightings and population stratum &amp;amp; PSU, is there a way to do a survey design in JMP? There is SAS code attached from the CDC below as well as R &amp;amp; Stata code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://wwwn.cdc.gov/nchs/nhanes/tutorials/Module4.aspx" target="_blank"&gt;https://wwwn.cdc.gov/nchs/nhanes/tutorials/Module4.aspx&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&amp;nbsp;&lt;BR /&gt;SAS&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;PROC SURVEYMEANS data=one varmethod=taylor nomcar;
  STRATA sdmvstra;
  CLUSTER sdmvpsu;
  WEIGHT WTMEC4YR;
  DOMAIN Select;
   * more statements...;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Ideally, I can get this done so that I can run the tabulate function, which I am very found of in JMP.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 21:59:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Taylor-Series-Linearization-to-Calculate-Variance-in-NHANES/m-p/336913#M58435</guid>
      <dc:creator>MikeDereviankin</dc:creator>
      <dc:date>2023-06-09T21:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Taylor Series Linearization to Calculate Variance in NHANES</title>
      <link>https://community.jmp.com/t5/Discussions/Taylor-Series-Linearization-to-Calculate-Variance-in-NHANES/m-p/337234#M58472</link>
      <description>&lt;P&gt;I am not sure whether you can do this in just JMP/JSL, but JMP makes it so convenient to run R code I wonder if it is worth reinventing the wheel here. You could let R do the analysis and then bring results back into JMP to use tabulate/graph builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've not tested this, but after installing R your code would look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;- svydesign(data=dt, id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC4YR, nest=TRUE)                    
	NHANES &amp;lt;- subset(NHANES_all, inAnalysis==1)
	m &amp;lt;- svymean(~Depression, NHANES)
	
]\" );

//return data from R
svymean = R Get( m )

//Close R
R Term();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;More info on integrating R with JMP:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.jmp.com/en_au/events/ondemand/mastering-jmp/jmp-and-r-integration.html" target="_blank" rel="noopener"&gt;https://www.jmp.com/en_au/events/ondemand/mastering-jmp/jmp-and-r-integration.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMPer-Cable/Getting-started-with-the-JMP-to-R-Interface/ba-p/43920" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/JMPer-Cable/Getting-started-with-the-JMP-to-R-Interface/ba-p/43920&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is some info on the R package they use:&lt;/P&gt;&lt;P&gt;&lt;A href="https://cran.r-project.org/web/packages/survey/survey.pdf" target="_blank" rel="noopener"&gt;https://cran.r-project.org/web/packages/survey/survey.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 22:46:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Taylor-Series-Linearization-to-Calculate-Variance-in-NHANES/m-p/337234#M58472</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-11-24T22:46:11Z</dc:date>
    </item>
  </channel>
</rss>

