I am working with data that contains missing values (I have several variables (across the columns) and several observations (across the rows) in an excel spreadsheet).
Example of the data structure:
obs var1 var2 ... var30
1 100 1
2 . 0
3 30 1
4. 20 .
...
After importing the data:
names = Import["Example_Data.xls", {"Data", 1, 1}];
data = Drop[Import["Example_Data.xls", {"Data", 1}], 1]
I want to create a simple correlation table:
corrm = Correlation[data] //MatrixForm
Questions:
How can I calculate the Correlation here given that I have missing data?
More generally, how do I work with missing data in mathematica? I have previously worked with Stata where missing values are taken care of under the hood. With that said, will I get the same correlation values here if I simply remove the missing values as I would if I tried to calculate the correlation using a statistical package such as e.g. Stata?
[EDIT] For question #2 above I found the following entry useful (http://www.ats.ucla.edu/stat/stata/output/stata_corr_output.htm). It seems that the standard procedure for statistical programs such as Stata is to delete each observation containing a missing value for one or more of its variables. As such, I would appreciate a method for answering question #1 using a similar method.
NOTE: After a preliminary search I found the following resources helpful (but they did not answer my questions): http://mathematica.stackexchange.com/questions/29159/correlation-with-missing-data http://reference.wolfram.com/language/howto/ReplaceOrRemoveInvalidOrMissingData.html