How to import statistics data (* .sta) into R

I am a master student and I have a statistics course with the STATISTICA program. I am fairly familiar with R and would like to stick with that. So I plan on doing the provided exercises in R. However, the data to work with is in * .sta format ... is there a way to import such a file into R? Any workaround is also fine as long as it doesn't compromise the data.

I actually found the same question 2 years ago here , but there was no answer.

I would be very happy for any suggestions!

Thanks Lukas

+3


source to share


2 answers


If R does not support importing Statistica statistics files (.sta files), Statistica supports exporting data to .xlsx, .csv and SPSS and SAS files. I would have thought one of them would be able to be handled by R natively.



+1


source


If you enable Statistica-R integration through Statistica, a package named COMadaptR will be installed in R.

Once this is done, you have several options:



  • You can run the R script inside Statistica using extensions (provided by Statistica) ActiveDataSet or tables to access the Statistica table as an R dataframe.

  • You can create an R node in the workspace; connect the Statistica table to the R node in the workspace; and then run the R script through node. ActiveDataSet and Spreadsheet will be available in the R node context.

  • You can write a small R script (and use an ActiveDataSet or Table) and run it in Statistica; the R integration functions convert the Statistica table to an R dataframe. You can then save it to disk in your script and work on it later.

  • The COMadaptR package will allow you to interact with Statistica via COM from R; you can use this approach to read data from a Statistica table.

Hope it helps.

+1


source







All Articles