Packages for repeating kappa test on multiple datasets
I'm new to R and I have to run Fleiss's kappa on over a thousand pre-made dataframes. I know how it's done individually:
kappam.fleiss(df1, exact=TRUE)
But I have to run the same test across every dataframe:
kappam.fleiss(df1, exact=TRUE)
kappam.fleiss(df2, exact=TRUE)
kappam.fleiss(df3, exact=TRUE)
...
...
kappam.fleiss(df5166, exact=TRUE)
I'm having some trouble phrasing my question correctly, but all I've found so far seem to be loops and functions which don't rightly work when I'm trying to combine dataframes - c(df1, df2, df3, ..., df5166)
Anyone can point me in the right direction?
r
add a comment |
I'm new to R and I have to run Fleiss's kappa on over a thousand pre-made dataframes. I know how it's done individually:
kappam.fleiss(df1, exact=TRUE)
But I have to run the same test across every dataframe:
kappam.fleiss(df1, exact=TRUE)
kappam.fleiss(df2, exact=TRUE)
kappam.fleiss(df3, exact=TRUE)
...
...
kappam.fleiss(df5166, exact=TRUE)
I'm having some trouble phrasing my question correctly, but all I've found so far seem to be loops and functions which don't rightly work when I'm trying to combine dataframes - c(df1, df2, df3, ..., df5166)
Anyone can point me in the right direction?
r
You hopefully realize that exact tests are not any kind of magic wand that prevents the Multiple Comparisons Dragon from blowing flames all over this effort and turning it into ashes?
– 42-
Nov 20 '18 at 3:07
canonical "lists of data frames" answer: stackoverflow.com/a/24376207/4497050
– alistaire
Nov 20 '18 at 4:52
add a comment |
I'm new to R and I have to run Fleiss's kappa on over a thousand pre-made dataframes. I know how it's done individually:
kappam.fleiss(df1, exact=TRUE)
But I have to run the same test across every dataframe:
kappam.fleiss(df1, exact=TRUE)
kappam.fleiss(df2, exact=TRUE)
kappam.fleiss(df3, exact=TRUE)
...
...
kappam.fleiss(df5166, exact=TRUE)
I'm having some trouble phrasing my question correctly, but all I've found so far seem to be loops and functions which don't rightly work when I'm trying to combine dataframes - c(df1, df2, df3, ..., df5166)
Anyone can point me in the right direction?
r
I'm new to R and I have to run Fleiss's kappa on over a thousand pre-made dataframes. I know how it's done individually:
kappam.fleiss(df1, exact=TRUE)
But I have to run the same test across every dataframe:
kappam.fleiss(df1, exact=TRUE)
kappam.fleiss(df2, exact=TRUE)
kappam.fleiss(df3, exact=TRUE)
...
...
kappam.fleiss(df5166, exact=TRUE)
I'm having some trouble phrasing my question correctly, but all I've found so far seem to be loops and functions which don't rightly work when I'm trying to combine dataframes - c(df1, df2, df3, ..., df5166)
Anyone can point me in the right direction?
r
r
edited Nov 20 '18 at 4:49
alistaire
31.5k43564
31.5k43564
asked Nov 20 '18 at 2:54


LifeOneLifeOne
1
1
You hopefully realize that exact tests are not any kind of magic wand that prevents the Multiple Comparisons Dragon from blowing flames all over this effort and turning it into ashes?
– 42-
Nov 20 '18 at 3:07
canonical "lists of data frames" answer: stackoverflow.com/a/24376207/4497050
– alistaire
Nov 20 '18 at 4:52
add a comment |
You hopefully realize that exact tests are not any kind of magic wand that prevents the Multiple Comparisons Dragon from blowing flames all over this effort and turning it into ashes?
– 42-
Nov 20 '18 at 3:07
canonical "lists of data frames" answer: stackoverflow.com/a/24376207/4497050
– alistaire
Nov 20 '18 at 4:52
You hopefully realize that exact tests are not any kind of magic wand that prevents the Multiple Comparisons Dragon from blowing flames all over this effort and turning it into ashes?
– 42-
Nov 20 '18 at 3:07
You hopefully realize that exact tests are not any kind of magic wand that prevents the Multiple Comparisons Dragon from blowing flames all over this effort and turning it into ashes?
– 42-
Nov 20 '18 at 3:07
canonical "lists of data frames" answer: stackoverflow.com/a/24376207/4497050
– alistaire
Nov 20 '18 at 4:52
canonical "lists of data frames" answer: stackoverflow.com/a/24376207/4497050
– alistaire
Nov 20 '18 at 4:52
add a comment |
1 Answer
1
active
oldest
votes
We place the datasets in a list
and apply the function
out <- lapply(mget(paste0("df", 1:5166)), kappm.fleiss, exact = TRUE)
NOTE: It is unusual to have these many objects loaded in the global environment. A better option would be to not create any objects globally, instead create a single list by loading the files into the list (if the dataset objects are read from a folder)
Would there be an alternative, for the above if the data frames are not given nice names? Instead of df1, df2, ..., df50, I have df1, ab2, ru6, etc?
– LifeOne
Nov 20 '18 at 4:35
@LifeOne If there are no patterns and these are the only objects loaded inthe global env, thenmget(ls())
– akrun
Nov 20 '18 at 5:16
add a comment |
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%2f53385544%2fpackages-for-repeating-kappa-test-on-multiple-datasets%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
We place the datasets in a list
and apply the function
out <- lapply(mget(paste0("df", 1:5166)), kappm.fleiss, exact = TRUE)
NOTE: It is unusual to have these many objects loaded in the global environment. A better option would be to not create any objects globally, instead create a single list by loading the files into the list (if the dataset objects are read from a folder)
Would there be an alternative, for the above if the data frames are not given nice names? Instead of df1, df2, ..., df50, I have df1, ab2, ru6, etc?
– LifeOne
Nov 20 '18 at 4:35
@LifeOne If there are no patterns and these are the only objects loaded inthe global env, thenmget(ls())
– akrun
Nov 20 '18 at 5:16
add a comment |
We place the datasets in a list
and apply the function
out <- lapply(mget(paste0("df", 1:5166)), kappm.fleiss, exact = TRUE)
NOTE: It is unusual to have these many objects loaded in the global environment. A better option would be to not create any objects globally, instead create a single list by loading the files into the list (if the dataset objects are read from a folder)
Would there be an alternative, for the above if the data frames are not given nice names? Instead of df1, df2, ..., df50, I have df1, ab2, ru6, etc?
– LifeOne
Nov 20 '18 at 4:35
@LifeOne If there are no patterns and these are the only objects loaded inthe global env, thenmget(ls())
– akrun
Nov 20 '18 at 5:16
add a comment |
We place the datasets in a list
and apply the function
out <- lapply(mget(paste0("df", 1:5166)), kappm.fleiss, exact = TRUE)
NOTE: It is unusual to have these many objects loaded in the global environment. A better option would be to not create any objects globally, instead create a single list by loading the files into the list (if the dataset objects are read from a folder)
We place the datasets in a list
and apply the function
out <- lapply(mget(paste0("df", 1:5166)), kappm.fleiss, exact = TRUE)
NOTE: It is unusual to have these many objects loaded in the global environment. A better option would be to not create any objects globally, instead create a single list by loading the files into the list (if the dataset objects are read from a folder)
answered Nov 20 '18 at 3:02
akrunakrun
401k13190265
401k13190265
Would there be an alternative, for the above if the data frames are not given nice names? Instead of df1, df2, ..., df50, I have df1, ab2, ru6, etc?
– LifeOne
Nov 20 '18 at 4:35
@LifeOne If there are no patterns and these are the only objects loaded inthe global env, thenmget(ls())
– akrun
Nov 20 '18 at 5:16
add a comment |
Would there be an alternative, for the above if the data frames are not given nice names? Instead of df1, df2, ..., df50, I have df1, ab2, ru6, etc?
– LifeOne
Nov 20 '18 at 4:35
@LifeOne If there are no patterns and these are the only objects loaded inthe global env, thenmget(ls())
– akrun
Nov 20 '18 at 5:16
Would there be an alternative, for the above if the data frames are not given nice names? Instead of df1, df2, ..., df50, I have df1, ab2, ru6, etc?
– LifeOne
Nov 20 '18 at 4:35
Would there be an alternative, for the above if the data frames are not given nice names? Instead of df1, df2, ..., df50, I have df1, ab2, ru6, etc?
– LifeOne
Nov 20 '18 at 4:35
@LifeOne If there are no patterns and these are the only objects loaded inthe global env, then
mget(ls())
– akrun
Nov 20 '18 at 5:16
@LifeOne If there are no patterns and these are the only objects loaded inthe global env, then
mget(ls())
– akrun
Nov 20 '18 at 5:16
add a comment |
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%2f53385544%2fpackages-for-repeating-kappa-test-on-multiple-datasets%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
You hopefully realize that exact tests are not any kind of magic wand that prevents the Multiple Comparisons Dragon from blowing flames all over this effort and turning it into ashes?
– 42-
Nov 20 '18 at 3:07
canonical "lists of data frames" answer: stackoverflow.com/a/24376207/4497050
– alistaire
Nov 20 '18 at 4:52