<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5033174205662795552</id><updated>2011-11-28T02:26:13.705+01:00</updated><category term='models'/><category term='web application'/><category term='inference'/><category term='R util'/><category term='descriptive'/><category term='prediction'/><category term='diagnosis'/><category term='validation'/><category term='muliple testing'/><title type='text'>Applications, programs and R statistical functions for epidemiology</title><subtitle type='html'>Comments on R functions (http://www.r-project.org) or applications for statistics, epidemiology, genetics and bioinformatics</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-626492869454829999</id><published>2008-11-27T22:32:00.003+01:00</published><updated>2008-11-27T22:58:38.423+01:00</updated><title type='text'>Correlation pairs plot</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_evESVUCj8-A/SS8X2EkSZDI/AAAAAAAAAEM/Xrb6WgoOf5U/s1600-h/panel.jpeg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 400px;" src="http://4.bp.blogspot.com/_evESVUCj8-A/SS8X2EkSZDI/AAAAAAAAAEM/Xrb6WgoOf5U/s400/panel.jpeg" alt="" id="BLOGGER_PHOTO_ID_5273459906380457010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;With this function (&lt;a href="http://bioinfo.iconcologia.net/r-epid/pairs.annot.r"&gt;pairs.annot&lt;/a&gt;) is easy to customize a panel plot to show the desired statistics:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-626492869454829999?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/626492869454829999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=626492869454829999' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/626492869454829999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/626492869454829999'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/11/correlation-pairs-plot.html' title='Correlation pairs plot'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_evESVUCj8-A/SS8X2EkSZDI/AAAAAAAAAEM/Xrb6WgoOf5U/s72-c/panel.jpeg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-1606516770179784876</id><published>2008-09-15T22:36:00.012+02:00</published><updated>2008-09-15T23:17:17.862+02:00</updated><title type='text'>Nice table output for logistic regression analysis</title><content type='html'>R is good for logistic regression analysis through &lt;span style="font-weight: bold;font-family:courier new;" &gt;glm&lt;/span&gt; function, but results are not very nice for report. Here I provide function that we call &lt;a href="http://bioinfo.iconcologia.net/r-epid/reglog.r"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;reglog&lt;/span&gt;&lt;/a&gt; that is useful to show relevant data for the analysis of a categorical covariate.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;reglog &lt;/span&gt;is called with a formula:  &lt;span style="font-weight: bold;font-family:courier new;" &gt;reglog(y~x+z)&lt;/span&gt;. You will get the analysis of variable x, adjusted for z respect to the binary response y. While x and y will be treated as factors if they are nor when suplied, covariates for adjustment can be numerical or factors. You can adjust for anything allowed in a &lt;span style="font-family:courier new;"&gt;glm &lt;/span&gt;formula, including interactions, but will not be shown. Interactions with x are not allowed. In a future post I will provide functions to study interactions.&lt;br /&gt;&lt;br /&gt;Similar to glm, &lt;span style="font-weight: bold;font-family:courier new;" &gt;reglog &lt;/span&gt;accepts a &lt;span style="font-family:courier new;"&gt;data&lt;/span&gt; argument with a data.frame containing the variables. Missing values are excluded and a subset argument can be used to select observations for analysis.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_evESVUCj8-A/SM7PwsLQhBI/AAAAAAAAADU/iuv-pMl9__w/s1600-h/reglog+example.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 435px; height: 526px;" src="http://3.bp.blogspot.com/_evESVUCj8-A/SM7PwsLQhBI/AAAAAAAAADU/iuv-pMl9__w/s400/reglog+example.png" alt="" id="BLOGGER_PHOTO_ID_5246359051332256786" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Sorry about the quality of this image. Blogspot doesn't allow better resolution and if I paste the text will not respect the spacing even if I use &amp;nsbp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-1606516770179784876?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/1606516770179784876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=1606516770179784876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/1606516770179784876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/1606516770179784876'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/09/nice-table-output-for-logistic.html' title='Nice table output for logistic regression analysis'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_evESVUCj8-A/SM7PwsLQhBI/AAAAAAAAADU/iuv-pMl9__w/s72-c/reglog+example.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-772413748200039840</id><published>2008-08-19T18:28:00.008+02:00</published><updated>2008-08-20T22:25:02.820+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='diagnosis'/><category scheme='http://www.blogger.com/atom/ns#' term='prediction'/><category scheme='http://www.blogger.com/atom/ns#' term='validation'/><title type='text'>Area under the ROC curve</title><content type='html'>The area under the ROC curve is a good measure of predictive accuracy for a binary event. Given a dataset with observed (0/1) and predicted values (probabilities), the function &lt;a href="http://bioinfo.iconcologia.net/r-epid/roc.r"&gt;roc &lt;/a&gt;will calculate for a series of cutpoints the sensitivity, specificity, likelihood ratios and the area under the ROC curve. This function will also produce three plots.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;font-family:courier new;" &gt;data(Ionosphere)&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;model &lt;- glm(Class ~ ., data=Ionosphere[,15:35], family=binomial)&lt;br /&gt;roc(predict(model,type="response"), Ionosphere$Class=="good")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(0, 0, 153);"&gt;cp   sens            espe&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[1,] 0.00 1.00000000 0.0000000&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[2,] 0.05 1.00000000 0.2380952&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[3,] 0.10 0.99555556 0.3412698&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[4,] 0.15 0.99555556 0.3809524&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[5,] 0.20 0.99555556 0.4206349&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[6,] 0.25 0.99111111 0.4365079&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[7,] 0.30 0.99111111 0.4603175&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[8,] 0.35 0.98222222 0.5000000&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[9,] 0.40 0.97777778 0.5317460&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[10,] 0.45 0.97333333 0.5634921&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[11,] 0.50 0.96444444 0.6111111&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[12,] 0.55 0.94222222 0.6507937&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[13,] 0.60 0.92000000 0.7301587&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[14,] 0.65 0.85333333 0.7777778&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[15,] 0.70 0.77333333 0.7936508&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[16,] 0.75 0.69333333 0.8174603&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[17,] 0.80 0.59555556 0.8412698&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[18,] 0.85 0.40888889 0.8888889&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[19,] 0.90 0.20000000 0.9285714&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[20,] 0.95 0.01777778 0.9603175&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;[21,] 1.00 0.00000000 1.0000000&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_evESVUCj8-A/SKr9rwsGEUI/AAAAAAAAADE/xl-LuvlhIb8/s1600-h/roc.png"&gt;&lt;img style="cursor: pointer; width: 379px; height: 242px;" src="http://2.bp.blogspot.com/_evESVUCj8-A/SKr9rwsGEUI/AAAAAAAAADE/xl-LuvlhIb8/s320/roc.png" alt="" id="BLOGGER_PHOTO_ID_5236276445017674050" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-772413748200039840?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/772413748200039840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=772413748200039840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/772413748200039840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/772413748200039840'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/08/area-under-roc-curve.html' title='Area under the ROC curve'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_evESVUCj8-A/SKr9rwsGEUI/AAAAAAAAADE/xl-LuvlhIb8/s72-c/roc.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-2795899262200124484</id><published>2008-07-29T18:31:00.004+02:00</published><updated>2008-08-20T22:25:34.132+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='inference'/><category scheme='http://www.blogger.com/atom/ns#' term='models'/><title type='text'>Confidence Intervals for glm and coxph models</title><content type='html'>Summary methods for linear and generalized linear models don't print nice confidence intervals. Use the &lt;a href="http://bioinfo.iconcologia.net/r-epid/intervals.r"&gt;intervals&lt;/a&gt; functions to get them easily. Following package nlme, intervals is generic and I have defined methods for glm and coxph. glm assumes a logistic regression model (family=binomial) an will show odds-ratios for covariates (not for the intercept).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;font-family:courier new;" &gt;fit&lt;-glm(disease~gender, family=binomial)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;font-family:courier new;" &gt;intervals(fit)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;           &lt;span style="color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;or     95%     C.I.     P-val &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt; genderMale   0.68 (   0.57 -   0.81 )  0.0000 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;font-family:courier new;" &gt;fit&lt;-coxph(Surv(time,status)~gender)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;font-family:courier new;" &gt;intervals(fit)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;                         &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr     95%     C.I.     P-val &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;&lt;span style="color: rgb(51, 51, 255);"&gt; genderMale   0.88 (   0.55 -   1.42 )  0.6061&lt;/span&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-2795899262200124484?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/2795899262200124484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=2795899262200124484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/2795899262200124484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/2795899262200124484'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/07/confidence-intervals-for-glm-models.html' title='Confidence Intervals for glm and coxph models'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-7020957343691705744</id><published>2008-07-07T20:05:00.003+02:00</published><updated>2008-08-20T22:26:00.420+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='R util'/><title type='text'>How big are my R objects?</title><content type='html'>I took me some time to find the function that provides the memory an R object uses: &lt;span style="font-weight: bold;font-family:courier new;" &gt;object.size()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The function &lt;a href="http://bioinfo.iconcologia.net/r-epid/lsiz.r"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;lsiz&lt;/span&gt;&lt;/a&gt; will show you the size of each object in an environment :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&gt; lsiz(4)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;Table                           28584&lt;br /&gt;qqpval                 6052&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The numbers show the object's size in bites.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-7020957343691705744?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/7020957343691705744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=7020957343691705744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/7020957343691705744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/7020957343691705744'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/07/how-big-are-my-r-objects.html' title='How big are my R objects?'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-8851289483590257161</id><published>2008-07-07T19:51:00.000+02:00</published><updated>2008-12-09T05:31:36.432+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='inference'/><category scheme='http://www.blogger.com/atom/ns#' term='muliple testing'/><title type='text'>Observed and Expected p-values</title><content type='html'>You have tested hundreds or thousands of hypothesis in a microarray experiment or a large genotyping association study and need to know if you have more significant results than expected by chance alone.&lt;br /&gt;&lt;br /&gt;Under the null, the distribution of p-values is uniform. You can plot the observed cumulative distribution of p-values against the expected under the null. The function &lt;a href="http://bioinfo.iconcologia.net/r-epid/qqpval.r"&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;qqpval&lt;/span&gt;&lt;/a&gt; will help you. I hope you get something better than that:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_evESVUCj8-A/SHJZwJ3nyVI/AAAAAAAAACg/OqrPTitIfIk/s1600-h/qqpval.png"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_evESVUCj8-A/SHJZwJ3nyVI/AAAAAAAAACg/OqrPTitIfIk/s320/qqpval.png" alt="" id="BLOGGER_PHOTO_ID_5220333601893632338" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-8851289483590257161?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/8851289483590257161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=8851289483590257161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/8851289483590257161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/8851289483590257161'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/07/observed-and-expected-p-values.html' title='Observed and Expected p-values'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_evESVUCj8-A/SHJZwJ3nyVI/AAAAAAAAACg/OqrPTitIfIk/s72-c/qqpval.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-2127834637981827031</id><published>2008-07-03T23:50:00.000+02:00</published><updated>2008-08-20T22:26:47.742+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='descriptive'/><title type='text'>Simple tables with percentages</title><content type='html'>You can crosstabulate categorical data in R with &lt;span style="font-weight: bold;font-family:courier new;" &gt;table()&lt;/span&gt;, and get percentages with &lt;span style="font-weight: bold;font-family:courier new;" &gt;prop.table()&lt;/span&gt;. To get a combination of both, I programmed &lt;span style="font-weight: bold;font-family:courier new;" &gt;Table()&lt;/span&gt;, that provides this type of output:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;&gt; pets&lt;-rep(c("cats","dogs"), 30)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;&gt; Table(pets)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;     pets  (%)    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;cats    30 ( 50.0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;dogs    30 ( 50.0)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;&gt; size&lt;-c("big","small")[sample(1:2,replace=TRUE, size=60 )]  &gt; Table(pets, size) &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;# row percentages by default&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      size&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;pets   big   (%)     small (%)    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  cats    13 ( 43.3)    17 ( 56.7)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  dogs    19 ( 63.3)    11 ( 36.7)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&gt; Table(pets, size, margin=2) &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;# column percentages&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      size&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;pets   big   (%)     small (%)    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  cats    13 ( 40.6)    17 ( 60.7)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  dogs    19 ( 59.4)    11 ( 39.3)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(204, 0, 0);"&gt;&gt; color&lt;-c("black","brown","grey")[sample(1:3,replace=TRUE, size=60 )]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(204, 0, 0);"&gt;&gt; Table(pets, size, color)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt; color = black &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;      size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;pets   big   (%)     small (%)    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;  cats     3 ( 33.3)     6 ( 66.7)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;  dogs     3 ( 75.0)     1 ( 25.0)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt; color = brown &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;      size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;pets   big   (%)     small (%)    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;  cats     6 ( 54.5)     5 ( 45.5)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;  dogs     6 ( 54.5)     5 ( 45.5)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt; color = grey &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;      size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;pets   big   (%)     small (%)    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;  cats     4 ( 40.0)     6 ( 60.0)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(51, 51, 255);"&gt;  dogs    10 ( 66.7)     5 ( 33.3)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Only up to 3 dimensions, but these should be enough most of the cases.&lt;br /&gt;&lt;br /&gt;You can download the code from &lt;a href="http://bioinfo.iconcologia.net/r-epid/Table.r"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I usually keep useful functions in an RData that I attach automatically in my Rprofile.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-2127834637981827031?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/2127834637981827031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=2127834637981827031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/2127834637981827031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/2127834637981827031'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/07/simple-tables-with-percentages.html' title='Simple tables with percentages'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-2521474732345958627</id><published>2008-07-01T23:22:00.000+02:00</published><updated>2008-08-20T22:26:18.638+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web application'/><title type='text'>SNPstats</title><content type='html'>This is a web application to perform statistical analysis of genetic epidemiology studies using SNPs. You will find it in &lt;a href="http://bioinfo.iconcologia.net/SNPstats" target=_blank&gt;http://bioinfo.iconcologia.net/SNPstats&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Some features include:&lt;br /&gt;- Upload of simple formatted SNP data and covariates&lt;br /&gt;- Easy selection of response, SNPs and covariates for each analysis&lt;br /&gt;- Binary or quantitative response&lt;br /&gt;- Analysis of single SNP: HWE, descriptive, association with response and interactions&lt;br /&gt;- Analysis of multiple SNPs: LD, haplotype frequencies, association with response and interactions&lt;br /&gt;- Nice HTML output&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-2521474732345958627?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/2521474732345958627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=2521474732345958627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/2521474732345958627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/2521474732345958627'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/07/snpstats.html' title='SNPstats'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5033174205662795552.post-8851072625631633892</id><published>2008-07-01T22:58:00.000+02:00</published><updated>2008-07-04T00:34:01.808+02:00</updated><title type='text'>Hello world</title><content type='html'>In these pages I plan to publish comments on R functions (&lt;a href="http://www.r-project.org/" target="_blank"&gt;http://www.r-project.org&lt;/a&gt;) or applications that I have been programming with coleagues at the Biostatistics and Bioinformatics Unit of the Catalan Institute of Oncology. Also comments and links and to other useful pages may appear.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5033174205662795552-8851072625631633892?l=r-epid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://r-epid.blogspot.com/feeds/8851072625631633892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5033174205662795552&amp;postID=8851072625631633892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/8851072625631633892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5033174205662795552/posts/default/8851072625631633892'/><link rel='alternate' type='text/html' href='http://r-epid.blogspot.com/2008/07/hello-world.html' title='Hello world'/><author><name>Victor Moreno</name><uri>http://www.blogger.com/profile/17010767371328968510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp1.blogger.com/_evESVUCj8-A/SGqfmufPxFI/AAAAAAAAACU/EPGNchHA6dI/S220/VM-simp.png'/></author><thr:total>0</thr:total></entry></feed>
