Skip to content

Commit 2111ee6

Browse files
authored
Update README.md
1 parent 343883e commit 2111ee6

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

README.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ _o2plsda_ provides functions to do O2PLS-DA analysis for multiple omics integrat
99
In order to avoid overfitting of the model, the optimal number of latent variables for each model structure was estimated using group-balanced MCCV. The package could use the group information when we select the best paramaters with cross-validation. In cross-validation (CV) one minimizes a certain measure of error over some parameters that should be determined a priori. Here, we have three parameters: (nc, nx, ny). A popular measure is the prediction error ||Y - \hat{Y}||, where \hat{Y} is a prediction of Y. In our case the O2PLS method is symmetric in X and Y, so we minimize the sum of the prediction errors:
1010
||X - \hat{X}||+||Y - \hat{Y}||.
1111

12-
And we also calculate the the average Q^2 values:
13-
14-
Q^2 = 1 - err / Var_{total};
15-
16-
err = Var_{expected} - Var_{estimated};
1712

1813
Here nc should be a positive integer, and nx and ny should be non-negative. The best integers are then the minimizers of the prediction error.
1914

@@ -48,38 +43,38 @@ set.seed(123)
4843
## ncores : parallel paramaters for large datasets
4944
cv <- o2cv(X,Y,1:5,1:3,1:3,group=group,nr_folds = 10)
5045
#####################################
51-
The best parameters are nc = 5, nx = 3, ny = 3
46+
The best parameters are nc = 1, nx = 2, ny = 3
5247
#####################################
53-
The Qxy is 0.0741821432027437 and the RMSE is: 2.02464376258545
48+
The the RMSE is: 1.98186790425324
5449
#####################################
5550
```
5651

57-
Then we can do the O2PLS analysis with nc = 5, nx = 3, ny =3. You can also select the best paramaters by looking at the cross validation results.
52+
Then we can do the O2PLS analysis with nc = 1, nx = 2, ny =3. You can also select the best paramaters by looking at the cross validation results.
5853
```{r}
59-
fit <- o2pls(X,Y,5,2,3)
54+
fit <- o2pls(X,Y,1,2,3)
6055
summary(fit)
6156
######### Summary of the O2PLS results #########
62-
### Call o2pls(X, Y, nc= 5 , nx= 2 , ny= 3 ) ###
57+
### Call o2pls(X, Y, nc= 1 , nx= 2 , ny= 3 ) ###
6358
### Total variation
6459
### X: 4900 ; Y: 4900 ###
65-
### Total modeled variation ### X: 0.261 ; Y: 0.314 ###
60+
### Total modeled variation ### X: 0.12 ; Y: 0.16 ###
6661
### Joint, Orthogonal, Noise (proportions) ###
6762
X Y
68-
Joint 0.186 0.199
69-
Orthogonal 0.075 0.115
70-
Noise 0.739 0.686
71-
### Variation in X joint part predicted by Y Joint part: 0.901
72-
### Variation in Y joint part predicted by X Joint part: 0.902
63+
Joint 0.041 0.047
64+
Orthogonal 0.079 0.113
65+
Noise 0.880 0.840
66+
### Variation in X joint part predicted by Y Joint part: 0.934
67+
### Variation in Y joint part predicted by X Joint part: 0.934
7368
### Variation in each Latent Variable (LV) in Joint part:
74-
LV1 LV2 LV3 LV4 LV5
75-
X 0.039 0.040 0.040 0.034 0.033
76-
Y 0.049 0.043 0.036 0.037 0.033
69+
LV1
70+
X 0.041
71+
Y 0.047
7772
### Variation in each Latent Variable (LV) in X Orthogonal part:
78-
LV1 LV2
79-
X 0.04 0.036
73+
LV1 LV2
74+
X 0.044 0.035
8075
### Variation in each Latent Variable (LV) in Y Orthogonal part:
8176
LV1 LV2 LV3
82-
Y 0.045 0.037 0.034
77+
Y 0.046 0.035 0.033
8378
8479
############################################
8580
@@ -96,7 +91,7 @@ plot(fit,type="loading",var="Xjoint", group=group,repel=F,rotation=TRUE)
9691

9792
Do the OPLSDA based on the O2PLS results
9893
```{r}
99-
res <- oplsda(fit,group, nc=5)
94+
res <- oplsda(fit,group, nc=1)
10095
plot(res,type="score", group=group)
10196
vip <- vip(res)
10297
plot(res,type="vip", group = group, repel = FALSE,order=TRUE)

0 commit comments

Comments
 (0)