Lukas
Lukas

Reputation: 223

How to Import statistica data (*.sta) into R

I'm a master student and I'm having a course in statistics with the program STATISTICA. I am rather familiar with R and would like to stick to it. So I am planning to do the provided exercises in R. However the data to work with is in the format *.sta... 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 to it.

I'd be very happy for any suggestions!

Thanks Lukas

Upvotes: 4

Views: 2670

Answers (2)

Venu Lolla
Venu Lolla

Reputation: 11

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

Once that is done, you have a couple of options:

  • You can run your R script inside of Statistica using the extensions (provided by Statistica) ActiveDataSet or Spreadsheet to access the Statistica spreadsheet as an R data frame.

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

  • You could write a small R script (and use ActiveDataSet or Spreadsheet) and run it in Statistica; the R integration features will translate the Statistica spreadsheet to an R data frame. You could then in your script store it to disk and work with it later.

  • The COMadaptR package will allow you to interact with Statistica through COM from within R; you could use that approach to read data from the Statistica spreadsheet.

Hope this helps.

Upvotes: 1

Joseph Willcoxson
Joseph Willcoxson

Reputation: 6050

If R does not support importing Statistica Spreadsheet files (.sta files), Statistica supports exporting data to .xlsx, .csv, and SPSS and SAS format files. I would think that one of those would be able to be handled by R natively.

Upvotes: 2

Related Questions