dear allI have a data set with three types (Tree, Sapling, Seedling). I have 
estimated the correlation values. now i need to bring all the correlation 
values in a table like the one i have shown in attached file with R codes.could 
you please give me idea on this problem
thanking you
MSNepal
                                          
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
read.table(....)
colnames(c.df)
[1] "id"      "code"    "long"    "lat"     "elev"    "age_obs" "year"   
 [8] "Est_age" "Ht_cm"   "BD_mm"   "CDA_cm"  "CDB_cm"  "growth"  "type"  

### Correlation estimation
cor(age_obs,Ht_cm)
cor(age_obs[type=='SD'],Ht_cm[type=='SD'])      #seedling
cor(age_obs[type=='SPB'],Ht_cm[type=='SPB'])    #sapling
cor(age_obs[type=='T'],Ht_cm[type=='T'])                #tree

cor(age_obs,BD_mm)
cor(age_obs[type=='SD'],BD_mm[type=='SD'])
cor(age_obs[type=='SPB'],BD_mm[type=='SPB'])
cor(age_obs[type=='T'],BD_mm[type=='T'])

cor(age_obs,CDA_cm)
cor(age_obs[type=='SD'],CDA_cm[type=='SD'])
cor(age_obs[type=='SPB'],CDA_cm[type=='SPB'])
cor(age_obs[type=='T'],CDA_cm[type=='T'])

cor(age_obs,CDB_cm)
cor(age_obs[type=='SD'],CDB_cm[type=='SD'])
cor(age_obs[type=='SPB'],CDB_cm[type=='SPB'])
cor(age_obs[type=='T'],CDB_cm[type=='T'])

cor(Ht_cm,BD_mm)
cor(Ht_cm[type=='SD'],BD_mm[type=='SD'])
cor(Ht_cm[type=='SPB'],BD_mm[type=='SPB'])
cor(Ht_cm[type=='T'],BD_mm[type=='T'])

cor(Ht_cm,CDA_cm)
cor(Ht_cm[type=='SD'],CDA_cm[type=='SD'])
cor(Ht_cm[type=='SPB'],CDA_cm[type=='SPB'])
cor(Ht_cm[type=='T'],CDA_cm[type=='T'])

cor(Ht_cm,CDB_cm)
cor(Ht_cm[type=='SD'],CDB_cm[type=='SD'])
cor(Ht_cm[type=='SPB'],CDB_cm[type=='SPB'])
cor(Ht_cm[type=='T'],CDB_cm[type=='T'])

cor(BD_mm,CDA_cm)
cor(BD_mm[type=='SD'],CDA_cm[type=='SD'])
cor(BD_mm[type=='SPB'],CDA_cm[type=='SPB'])
cor(BD_mm[type=='T'],CDA_cm[type=='T'])

cor(BD_mm,CDB_cm)
cor(BD_mm[type=='SD'],CDB_cm[type=='SD'])
cor(BD_mm[type=='SPB'],CDB_cm[type=='SPB'])
cor(BD_mm[type=='T'],CDB_cm[type=='T'])

cor(CDA_cm,CDB_cm)
cor(CDA_cm[type=='SD'],CDB_cm[type=='SD'])
cor(CDA_cm[type=='SPB'],CDB_cm[type=='SPB'])
cor(CDA_cm[type=='T'],CDB_cm[type=='T'])

cor(age_obs,Est_age,use="pairwise.complete.obs")
cor(age_obs[type=='SD'],Est_age[type=='SD'],use="pairwise.complete.obs")
cor(age_obs[type=='SPB'],Est_age[type=='SPB'],use="pairwise.complete.obs")
cor(age_obs[type=='T'],Est_age[type=='T'],use="pairwise.complete.obs")


###   table looks like below one

parameters              combined        seedling                sapling         
tree
age_obs Vs Ht_cm                                
age_obs Vs BD_mm                                
age_obs Vs CDA_cm                               
age_obs Vs CDB_cm                               
Ht_cm   Vs BD_mm                                
Ht_cm   Vs CDA_cm                               
Ht_cm   Vs CDB_cm                               
BD_mm   Vs CDA_cm                               
BD_mm   Vs CDB_cm                               
CDA_cm  Vs CDB_cm                               
age_obs Vs est_age                              










______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to