Note that there are some explanatory texts on larger screens.

plurals
  1. PONAs occuring in the output of logistic regression (using multinom) in R
    primarykey
    data
    text
    <p>I'm trying to perform logistic regression using <code>multinom()</code> of <code>nnet</code> package over the following data using R:<br> <a href="https://drive.google.com/file/d/0Bznk6HkWGRBYZ3ZIZzNrdE11TjQ/edit?usp=sharing" rel="nofollow" title="train_data.csv">Train Data</a><br> <a href="https://drive.google.com/file/d/0Bznk6HkWGRBYczNXeFl5cGxMNGc/edit?usp=sharing" rel="nofollow" title="test_data.csv">Test Data</a></p> <h3>Data Description:</h3> <p>Each of the train and test files have 10,000 rows of data and 144 variables, where the last column is "Predict", which is the column that should be predicted in the test data. Since, predict contains only two values 0 and 1 (binary), I started with fitting the train data to a logistic regression model using <code>multinom()</code>. Most of the rows are continuous numeric values, while a few fields contains name fields like names of a weekdays ("Sunday", "Monday", ...), which are to be considered as factors. </p> <p>This is the following code used: </p> <pre><code>train_data &lt;- read.csv("train_data.csv") test_data &lt;- read.csv("test_data.csv") library(nnet) my_multinom &lt;- multinom(formula= as.factor(Predict) ~ ., data= train_data) predictions &lt;- predict(my_multinom, test_data[,1:143]) </code></pre> <p>And the output is:</p> <pre><code>&gt; summary(predictions) 0 1 NA's 130 52 9818 </code></pre> <p>where as, there are no <code>NA's</code> in the <code>Predict</code> column of the <code>train_data</code>:</p> <pre><code>&gt; summary(as.factor(train_data$Predict)) 0 1 9734 266 </code></pre> <p>I want to know what is the reason for the occurrence of such a huge amount of <code>NA's</code> (more than 98%) and how to proceed further so that I could avoid these <code>NA's</code>?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload