Multiple Correlation in R

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a data frame presenting different variables in column and for different species name in rows as follow. In the column a have only one independent variables(Proteome size) and all the others are independent variables. I want to use the PIC package to correlate all these dependent variables separately to my independent variables, a way to generate the R coefficient and p-value.




data <- read.table("t1.txt", row.names = 1, header = T,sep='')
data
path1 path2 path3 path4 Proteome_size
ahli 4.0 -3.2 0.4 -1.0 -0.2
alayoni 3.8 3.4 -1.8 2.2 -0.3
alfaroi 3.5 2.6 0.8 -2.4 -0.5
aliniger 4.0 0.1 -1.7 2.4 0.0
allisoni 4.4 2.0 -3.7 0.5 -0.1
allogus 4.0 -2.8 0.6 -1.0 0.6
altitudinalis 3.8 2.9 -6.1 2.3 1.2
alumina 3.6 0.7 1.5 -2.7 -1.3
alutaceus 3.6 1.2 -0.6 -1.7 0.3
angusticeps 3.8 4.6 -2.0 1.2 1.7




I have this code following code that can correlate any one of the ‘path*’ column to proteome size:



upload the data



data <- read.csv("data.csv", row.names = 1)
tree <- read.tree("anolis.phy")



Extract columns

Proteome <- data[, "Proteome_size"]
awe <- data[, "path1"]



Give them names



names(Proteome_size) <- names(var1) <- rownames(data)



Calculate PICs



hPic <- pic(proteome_size, tree)
aPic <- pic(gene1, tree)



Make a model



picModel <- lm(hPic ~ aPic - 1)



summary



summary(picModel)



My question is that, how can I implement this code to do that for all the columns simultaneously and store the statistics info as (R and p_value) for each variable somewhere ?










share|improve this question

























    up vote
    0
    down vote

    favorite












    I have a data frame presenting different variables in column and for different species name in rows as follow. In the column a have only one independent variables(Proteome size) and all the others are independent variables. I want to use the PIC package to correlate all these dependent variables separately to my independent variables, a way to generate the R coefficient and p-value.




    data <- read.table("t1.txt", row.names = 1, header = T,sep='')
    data
    path1 path2 path3 path4 Proteome_size
    ahli 4.0 -3.2 0.4 -1.0 -0.2
    alayoni 3.8 3.4 -1.8 2.2 -0.3
    alfaroi 3.5 2.6 0.8 -2.4 -0.5
    aliniger 4.0 0.1 -1.7 2.4 0.0
    allisoni 4.4 2.0 -3.7 0.5 -0.1
    allogus 4.0 -2.8 0.6 -1.0 0.6
    altitudinalis 3.8 2.9 -6.1 2.3 1.2
    alumina 3.6 0.7 1.5 -2.7 -1.3
    alutaceus 3.6 1.2 -0.6 -1.7 0.3
    angusticeps 3.8 4.6 -2.0 1.2 1.7




    I have this code following code that can correlate any one of the ‘path*’ column to proteome size:



    upload the data



    data <- read.csv("data.csv", row.names = 1)
    tree <- read.tree("anolis.phy")



    Extract columns

    Proteome <- data[, "Proteome_size"]
    awe <- data[, "path1"]



    Give them names



    names(Proteome_size) <- names(var1) <- rownames(data)



    Calculate PICs



    hPic <- pic(proteome_size, tree)
    aPic <- pic(gene1, tree)



    Make a model



    picModel <- lm(hPic ~ aPic - 1)



    summary



    summary(picModel)



    My question is that, how can I implement this code to do that for all the columns simultaneously and store the statistics info as (R and p_value) for each variable somewhere ?










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a data frame presenting different variables in column and for different species name in rows as follow. In the column a have only one independent variables(Proteome size) and all the others are independent variables. I want to use the PIC package to correlate all these dependent variables separately to my independent variables, a way to generate the R coefficient and p-value.




      data <- read.table("t1.txt", row.names = 1, header = T,sep='')
      data
      path1 path2 path3 path4 Proteome_size
      ahli 4.0 -3.2 0.4 -1.0 -0.2
      alayoni 3.8 3.4 -1.8 2.2 -0.3
      alfaroi 3.5 2.6 0.8 -2.4 -0.5
      aliniger 4.0 0.1 -1.7 2.4 0.0
      allisoni 4.4 2.0 -3.7 0.5 -0.1
      allogus 4.0 -2.8 0.6 -1.0 0.6
      altitudinalis 3.8 2.9 -6.1 2.3 1.2
      alumina 3.6 0.7 1.5 -2.7 -1.3
      alutaceus 3.6 1.2 -0.6 -1.7 0.3
      angusticeps 3.8 4.6 -2.0 1.2 1.7




      I have this code following code that can correlate any one of the ‘path*’ column to proteome size:



      upload the data



      data <- read.csv("data.csv", row.names = 1)
      tree <- read.tree("anolis.phy")



      Extract columns

      Proteome <- data[, "Proteome_size"]
      awe <- data[, "path1"]



      Give them names



      names(Proteome_size) <- names(var1) <- rownames(data)



      Calculate PICs



      hPic <- pic(proteome_size, tree)
      aPic <- pic(gene1, tree)



      Make a model



      picModel <- lm(hPic ~ aPic - 1)



      summary



      summary(picModel)



      My question is that, how can I implement this code to do that for all the columns simultaneously and store the statistics info as (R and p_value) for each variable somewhere ?










      share|improve this question













      I have a data frame presenting different variables in column and for different species name in rows as follow. In the column a have only one independent variables(Proteome size) and all the others are independent variables. I want to use the PIC package to correlate all these dependent variables separately to my independent variables, a way to generate the R coefficient and p-value.




      data <- read.table("t1.txt", row.names = 1, header = T,sep='')
      data
      path1 path2 path3 path4 Proteome_size
      ahli 4.0 -3.2 0.4 -1.0 -0.2
      alayoni 3.8 3.4 -1.8 2.2 -0.3
      alfaroi 3.5 2.6 0.8 -2.4 -0.5
      aliniger 4.0 0.1 -1.7 2.4 0.0
      allisoni 4.4 2.0 -3.7 0.5 -0.1
      allogus 4.0 -2.8 0.6 -1.0 0.6
      altitudinalis 3.8 2.9 -6.1 2.3 1.2
      alumina 3.6 0.7 1.5 -2.7 -1.3
      alutaceus 3.6 1.2 -0.6 -1.7 0.3
      angusticeps 3.8 4.6 -2.0 1.2 1.7




      I have this code following code that can correlate any one of the ‘path*’ column to proteome size:



      upload the data



      data <- read.csv("data.csv", row.names = 1)
      tree <- read.tree("anolis.phy")



      Extract columns

      Proteome <- data[, "Proteome_size"]
      awe <- data[, "path1"]



      Give them names



      names(Proteome_size) <- names(var1) <- rownames(data)



      Calculate PICs



      hPic <- pic(proteome_size, tree)
      aPic <- pic(gene1, tree)



      Make a model



      picModel <- lm(hPic ~ aPic - 1)



      summary



      summary(picModel)



      My question is that, how can I implement this code to do that for all the columns simultaneously and store the statistics info as (R and p_value) for each variable somewhere ?







      r






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 11 mins ago









      Dieunel Derilus

      82




      82

























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480483%2fmultiple-correlation-in-r%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480483%2fmultiple-correlation-in-r%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay