create MRSETS with python code

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

create MRSETS with python code

oggesjolin
Hello, is it possible to create persistant MRSETS outside of SPSS with python? Looking to create MRSETS in R (reticulate) and export file as .sav with this meta data in place.

Reply | Threaded
Open this post in threaded view
|

Re: create MRSETS with python code

jkpeck
The easiest way to do that would be to create the MRSETS syntax in your R code and then execute it within syntax after load the sav file.  However, there is an api in the R interface to do this.

spssdictionary.SetMultiResponseSet Function
spssdictionary.SetMultiResponseSet(datasetName,mrsetName,mrsetLabel,codeAs,countedValue,el
ementaryVars). Defines multiple response sets. This function is used to define multiple response sets for
new IBM SPSS Statistics datasets created with the SetDictionaryToSPSS function.

See the R integration package doc for details.