Professor,
I have run the Naive Bayes Classifier on the FiveGene_qPCR and below are the results:
- Code: Select all
> bytimepoint<- naiveBayes(X._X1 ~., mydata, laplace = 0, subset, na.action = na.pass)
Naive Bayes Classifier for Discrete Predictors
Call:
naiveBayes.default(x = X, y = Y, laplace = laplace, ..1)
A-priori probabilities:
Y
0 1
0.5384615 0.4615385
Conditional probabilities:
X._X2
Y [,1] [,2]
0 0 0
1 1 0
X._X3
Y [,1] [,2]
0 0 0
1 1 0
X._X4
Y [,1] [,2]
0 0 0
1 1 0
X._X5
Y [,1] [,2]
0 0 0
1 1 0
When I change the outcome to to @_X2 or @_X3, it gave me the same results. I don't believe that these results are right due to how the probabilities are distributed within each contingency table. Consequently, I changed the coding of the excel sheet to where I would take the mean of each of the 5 genes, where anything larger than the mean was coded as 1 and anything less than the mean was coded as zero. The 1st code has X1 as the outcome variable. See results below:
- Code: Select all
> bymeans <- naiveBayes(X._X1 ~., mydata, laplace = 0, subset, na.action = na.pass)
Naive Bayes Classifier for Discrete Predictors
Call:
naiveBayes.default(x = X, y = Y, laplace = laplace, ..1)
A-priori probabilities:
Y
0 1
0.5 0.5
Conditional probabilities:
X._X2
Y [,1] [,2]
0 0.2307692 0.4385290
1 0.6923077 0.4803845
X._X3
Y [,1] [,2]
0 0.3846154 0.5063697
1 0.7692308 0.4385290
X._X4
Y [,1] [,2]
0 0.3076923 0.4803845
1 0.6153846 0.5063697
X._X5
Y [,1] [,2]
0 0.07692308 0.2773501
1 0.69230769 0.4803845
The code below has x2 as the outcome variable:
- Code: Select all
> bymeans <- naiveBayes(X._X2 ~., mydata, laplace = 0, subset, na.action = na.pass)
Naive Bayes Classifier for Discrete Predictors
Call:
naiveBayes.default(x = X, y = Y, laplace = laplace, ..1)
A-priori probabilities:
Y
0 1
0.5384615 0.4615385
Conditional probabilities:
X._X1
Y [,1] [,2]
0 0.2857143 0.4688072
1 0.7500000 0.4522670
X._X3
Y [,1] [,2]
0 0.5714286 0.5135526
1 0.5833333 0.5149287
X._X4
Y [,1] [,2]
0 0.4285714 0.5135526
1 0.5000000 0.5222330
X._X5
Y [,1] [,2]
0 0.1428571 0.3631365
1 0.6666667 0.4923660
The code below has x3 as the outcome variable:
- Code: Select all
> bymeans <- naiveBayes(X._X3 ~., mydata, laplace = 0, subset, na.action = na.pass)
Naive Bayes Classifier for Discrete Predictors
Call:
naiveBayes.default(x = X, y = Y, laplace = laplace, ..1)
A-priori probabilities:
Y
0 1
0.4230769 0.5769231
Conditional probabilities:
X._X1
Y [,1] [,2]
0 0.2727273 0.4670994
1 0.6666667 0.4879500
X._X2
Y [,1] [,2]
0 0.4545455 0.5222330
1 0.4666667 0.5163978
X._X4
Y [,1] [,2]
0 0.1818182 0.4045199
1 0.6666667 0.4879500
X._X5
Y [,1] [,2]
0 0.1818182 0.4045199
1 0.5333333 0.5163978
The code below has x4 as the outcome variable:
- Code: Select all
> bymeans <- naiveBayes(X._X4 ~., mydata, laplace = 0, subset, na.action = na.pass)
Naive Bayes Classifier for Discrete Predictors
Call:
naiveBayes.default(x = X, y = Y, laplace = laplace, ..1)
A-priori probabilities:
Y
0 1
0.5384615 0.4615385
Conditional probabilities:
X._X1
Y [,1] [,2]
0 0.3571429 0.4972452
1 0.6666667 0.4923660
X._X2
Y [,1] [,2]
0 0.4285714 0.5135526
1 0.5000000 0.5222330
X._X3
Y [,1] [,2]
0 0.3571429 0.4972452
1 0.8333333 0.3892495
X._X5
Y [,1] [,2]
0 0.3571429 0.4972452
1 0.4166667 0.5149287
The code below has x5 as the outcome variable:
- Code: Select all
> bymeans <- naiveBayes(X._X5 ~., mydata, laplace = 0, subset, na.action = na.pass)
Naive Bayes Classifier for Discrete Predictors
Call:
naiveBayes.default(x = X, y = Y, laplace = laplace, ..1)
A-priori probabilities:
Y
0 1
0.6153846 0.3846154
Conditional probabilities:
X._X1
Y [,1] [,2]
0 0.25 0.4472136
1 0.90 0.3162278
X._X2
Y [,1] [,2]
0 0.25 0.4472136
1 0.80 0.4216370
X._X3
Y [,1] [,2]
0 0.4375 0.5123475
1 0.8000 0.4216370
X._X4
Y [,1] [,2]
0 0.4375 0.5123475
1 0.5000 0.5270463
P.S. I have attached the excel sheet and the two text files with the two types of coding.