Multiple Correlation in R
Clash 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 ?
r
add a comment |Â
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 ?
r
add a comment |Â
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 ?
r
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
r
asked 11 mins ago
Dieunel Derilus
82
82
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
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
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
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
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