create a sequence (group) of numbers from the 1-ibs matrix
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm a newbie with R and I'm trying to generate this kind of sequence (see below) from a matrix and then estimate an error rate. Just to let you know, I have triplicates for each number, that's why I have X1, X1.1 and X1.2
X1 X1.1 X1.2
X1 0.000000000 NA NA
X1.1 0.013452613 0.000000000 NA
X1.2 0.008110273 0.007781853 0
X73 X73.1 X73.2
X73 0.00000000 NA NA
X73.1 0.05336268 0.00000000 NA
X73.2 0.04450677 0.05150902 0
and so on...
I applied this code (NB: 261 is the number of samples)
mat <- 1-ibsmat
mat1 <- mat[-99:-100,-99:-100]
x <- seq(1,261,3)
err.r <- rep(NA, length(x))
for (i in 1:(length(x)-1)){
k <- x[i]
k1=k+2
ibx <- mat1[k:k1,k:k1]
print(ibx)
err.r[i] <- mean(ibx[lower.tri(ibx)])
}
errorrate <- mean(na.omit(err.r))
Everything works fine until the numbers starts to overlap with others (see example below).
X91.1 X91.2 X12
X91.1 0.00000000 NA NA
X91.2 0.01587456 0.0000000 NA
X12 0.10722157 0.1139528 0
Do you have any clue?
python r windows matrix
add a comment |
I'm a newbie with R and I'm trying to generate this kind of sequence (see below) from a matrix and then estimate an error rate. Just to let you know, I have triplicates for each number, that's why I have X1, X1.1 and X1.2
X1 X1.1 X1.2
X1 0.000000000 NA NA
X1.1 0.013452613 0.000000000 NA
X1.2 0.008110273 0.007781853 0
X73 X73.1 X73.2
X73 0.00000000 NA NA
X73.1 0.05336268 0.00000000 NA
X73.2 0.04450677 0.05150902 0
and so on...
I applied this code (NB: 261 is the number of samples)
mat <- 1-ibsmat
mat1 <- mat[-99:-100,-99:-100]
x <- seq(1,261,3)
err.r <- rep(NA, length(x))
for (i in 1:(length(x)-1)){
k <- x[i]
k1=k+2
ibx <- mat1[k:k1,k:k1]
print(ibx)
err.r[i] <- mean(ibx[lower.tri(ibx)])
}
errorrate <- mean(na.omit(err.r))
Everything works fine until the numbers starts to overlap with others (see example below).
X91.1 X91.2 X12
X91.1 0.00000000 NA NA
X91.2 0.01587456 0.0000000 NA
X12 0.10722157 0.1139528 0
Do you have any clue?
python r windows matrix
add a comment |
I'm a newbie with R and I'm trying to generate this kind of sequence (see below) from a matrix and then estimate an error rate. Just to let you know, I have triplicates for each number, that's why I have X1, X1.1 and X1.2
X1 X1.1 X1.2
X1 0.000000000 NA NA
X1.1 0.013452613 0.000000000 NA
X1.2 0.008110273 0.007781853 0
X73 X73.1 X73.2
X73 0.00000000 NA NA
X73.1 0.05336268 0.00000000 NA
X73.2 0.04450677 0.05150902 0
and so on...
I applied this code (NB: 261 is the number of samples)
mat <- 1-ibsmat
mat1 <- mat[-99:-100,-99:-100]
x <- seq(1,261,3)
err.r <- rep(NA, length(x))
for (i in 1:(length(x)-1)){
k <- x[i]
k1=k+2
ibx <- mat1[k:k1,k:k1]
print(ibx)
err.r[i] <- mean(ibx[lower.tri(ibx)])
}
errorrate <- mean(na.omit(err.r))
Everything works fine until the numbers starts to overlap with others (see example below).
X91.1 X91.2 X12
X91.1 0.00000000 NA NA
X91.2 0.01587456 0.0000000 NA
X12 0.10722157 0.1139528 0
Do you have any clue?
python r windows matrix
I'm a newbie with R and I'm trying to generate this kind of sequence (see below) from a matrix and then estimate an error rate. Just to let you know, I have triplicates for each number, that's why I have X1, X1.1 and X1.2
X1 X1.1 X1.2
X1 0.000000000 NA NA
X1.1 0.013452613 0.000000000 NA
X1.2 0.008110273 0.007781853 0
X73 X73.1 X73.2
X73 0.00000000 NA NA
X73.1 0.05336268 0.00000000 NA
X73.2 0.04450677 0.05150902 0
and so on...
I applied this code (NB: 261 is the number of samples)
mat <- 1-ibsmat
mat1 <- mat[-99:-100,-99:-100]
x <- seq(1,261,3)
err.r <- rep(NA, length(x))
for (i in 1:(length(x)-1)){
k <- x[i]
k1=k+2
ibx <- mat1[k:k1,k:k1]
print(ibx)
err.r[i] <- mean(ibx[lower.tri(ibx)])
}
errorrate <- mean(na.omit(err.r))
Everything works fine until the numbers starts to overlap with others (see example below).
X91.1 X91.2 X12
X91.1 0.00000000 NA NA
X91.2 0.01587456 0.0000000 NA
X12 0.10722157 0.1139528 0
Do you have any clue?
python r windows matrix
python r windows matrix
edited Nov 22 '18 at 19:39
N Meriam
asked Nov 21 '18 at 23:03
N MeriamN Meriam
145
145
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421670%2fcreate-a-sequence-group-of-numbers-from-the-1-ibs-matrix%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421670%2fcreate-a-sequence-group-of-numbers-from-the-1-ibs-matrix%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown