Bubble chart

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
ens
Reply | Threaded
Open this post in threaded view
|

Bubble chart

ens
I have a matrix of p-values for for each explanatory variable. Each row is an area of the response variable and each column is an explanatory variable.

e.g.
   PSA   pval_DOY pval_PDSIconcurrent pval_PDSIantecedent_annual_average pval_TMAXanomaly pval_FM100anomaly
1 NC06 0.96747495           0.6092668                         0.53353019        0.9301115        0.99801334
2 NC04 0.04699659           0.2759152                         0.07024752        0.6046828        0.03224094
3 NC01 0.71437394           0.9979173                         0.85296024        0.9977558        0.99833623
4 NC08 0.67315904           0.9970511                         0.51756714        0.7809994        0.99626038
5 NC07 0.55221280           0.5784208                         0.43975219        0.3669491        0.34898877
6 NC05 0.52089881           0.7191645                         0.91972153        0.4487460        0.94922430

I want to create a visual display such that instead of #s for the p-values, I have a circle sized to represent the size of the p-value.

symbolys() is what I've found to do this, but it isn't clear to me how to format the input for the function.

Any suggestions? or help? Even a link if someone else has asked the question and it's been answered would be helpful.
Reply | Threaded
Open this post in threaded view
|

Re: Bubble chart

Jim Lemon
On 03/22/2012 03:22 PM, ens wrote:

> I have a matrix of p-values for for each explanatory variable. Each row is an
> area of the response variable and each column is an explanatory variable.
>
> e.g.
>     PSA   pval_DOY pval_PDSIconcurrent pval_PDSIantecedent_annual_average
> pval_TMAXanomaly pval_FM100anomaly
> 1 NC06 0.96747495           0.6092668                         0.53353019
> 0.9301115        0.99801334
> 2 NC04 0.04699659           0.2759152                         0.07024752
> 0.6046828        0.03224094
> 3 NC01 0.71437394           0.9979173                         0.85296024
> 0.9977558        0.99833623
> 4 NC08 0.67315904           0.9970511                         0.51756714
> 0.7809994        0.99626038
> 5 NC07 0.55221280           0.5784208                         0.43975219
> 0.3669491        0.34898877
> 6 NC05 0.52089881           0.7191645                         0.91972153
> 0.4487460        0.94922430
>
> I want to create a visual display such that instead of #s for the p-values,
> I have a circle sized to represent the size of the p-value.
>
> symbolys() is what I've found to do this, but it isn't clear to me how to
> format the input for the function.
>
> Any suggestions?

Hi ens,
You might be interested in the "size_n_color" function (plotrix). I'll
be uploading v3.4 shortly, and you can use that to do it like this:

psa.mat
        pval_DOY pval_PDSIconcurrent pval_PDSIaaa pval_TMAXanomaly
NC06 0.96747495           0.6092668   0.53353019        0.9301115
NC04 0.04699659           0.2759152   0.07024752        0.6046828
NC01 0.71437394           0.9979173   0.85296024        0.9977558
NC08 0.67315904           0.9970511   0.51756714        0.7809994
NC07 0.55221280           0.5784208   0.43975219        0.3669491
NC05 0.52089881           0.7191645   0.91972153        0.4487460
      pval_FM100anomaly
NC06        0.99801334
NC04        0.03224094
NC01        0.99833623
NC08        0.99626038
NC07        0.34898877
NC05        0.94922430
size_n_color(size=psa.mat,col="black",xaxlab=rep("",5),
  yaxlab=rownames(psa.mat))
staxlab(1,at=seq(2,10,by=2),colnames(psa.mat))

Jim

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Bubble chart

David Winsemius
In reply to this post by ens

On Mar 22, 2012, at 12:22 AM, ens wrote:

> I have a matrix of p-values for for each explanatory variable. Each  
> row is an
> area of the response variable and each column is an explanatory  
> variable.
>
> e.g.
>   PSA   pval_DOY pval_PDSIconcurrent  
> pval_PDSIantecedent_annual_average
> pval_TMAXanomaly pval_FM100anomaly
> 1 NC06 0.96747495           0.6092668                          
> 0.53353019
> 0.9301115        0.99801334
> 2 NC04 0.04699659           0.2759152                          
> 0.07024752
> 0.6046828        0.03224094
> 3 NC01 0.71437394           0.9979173                          
> 0.85296024
> 0.9977558        0.99833623
> 4 NC08 0.67315904           0.9970511                          
> 0.51756714
> 0.7809994        0.99626038
> 5 NC07 0.55221280           0.5784208                          
> 0.43975219
> 0.3669491        0.34898877
> 6 NC05 0.52089881           0.7191645                          
> 0.91972153
> 0.4487460        0.94922430
>
> I want to create a visual display such that instead of #s for the p-
> values,
> I have a circle sized to represent the size of the p-value.

Wouldn't that convey exactly the wrong information? Unless that is p-
value has some sort of non-statistical meaning?

--
David.

>
> symbolys() is what I've found to do this, but it isn't clear to me  
> how to
> format the input for the function.
>
> Any suggestions? or help? Even a link if someone else has asked the  
> question
> and it's been answered would be helpful.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Bubble-chart-tp4494539p4494539.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.