├── .gitignore ├── DESCRIPTION ├── LICENSE ├── PET-PEESE test ├── input_data.csv └── load.R ├── README.md ├── TIVA.R ├── TODO.md ├── demo-data ├── 855_t_tests.txt ├── Bem2011.txt ├── H0_100x5.txt ├── H0_hack_100x5.txt ├── H1_100x5.txt ├── IQ_grades.txt ├── JPSP-p-curve.txt ├── Shanks.txt ├── elderly_priming.txt ├── glucose.txt ├── moneypriming.txt └── powerposing.txt ├── fasterParser.R ├── helpers.R ├── original code from others ├── Colada-37-p-curve-disclosure-table-for-Power-Posing.xlsx ├── Gervais_PowerCode_final.R ├── Roth-IQ.ods ├── Shanks Meta-analysis_data.xlsx ├── Simonsohn_p-curve-code.R ├── VadilloHardwickeShanks_effect_sizes edited.xlsx ├── VadilloHardwickeShanks_effect_sizes.xlsx ├── VadilloHardwickeShanks_pcurve_disclosure_table.xlsx ├── comparisonMoney.R ├── input_data.csv ├── oldParser.R ├── old_p_curve_get33.R └── p-curve disclosure table.xlsx ├── p-checker.Rproj ├── p-curve.R ├── pancollapse.R ├── run.R ├── server.R ├── snippets ├── about.html ├── demo_syntax.txt ├── extended_manual.html ├── quick_start.html ├── responsibly.html └── version_history.html ├── tests.R ├── tests └── Dunlap paired t-tests.R ├── ui.R └── www ├── accordion.css ├── busy.css ├── busy.js ├── demo-pics └── powerposing.jpg ├── loading.css ├── p-checker-theme.css ├── pancollapse.css ├── pancollapse.js ├── preloader.gif └── showstartmessage.js /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # History & Project Files 3 | .Rhistory 4 | .Rapp.history 5 | .Rproj 6 | .RData 7 | 8 | # Sandbox directory 9 | /.sandbox 10 | 11 | # Example code in package build process 12 | *-Ex.R 13 | .Rproj.user 14 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: R-index and p-Curve App 2 | Author: Felix Schönbrodt, with code from Uri Simonsohn & Moritz Heene 3 | AuthorUrl: http://www.nicebread.de 4 | License: GPL-3 5 | DisplayMode: Normal 6 | Type: Shiny 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /PET-PEESE test/input_data.csv: -------------------------------------------------------------------------------- 1 | "","line","paper_id","study_id","focal","type","df1","df2","d","g","n.approx","statistic","p.value","p.value.one","p.reported","p.crit","significant","one.tailed","reporting.error","error.direction","parse.error","d.reported","d.reported.str","d.reported.lower","d.reported.upper","d.reported.error","d.reported.error.direction","global.reporting.error","p.value.log","d.var","d.se","Z","obs.pow","median.obs.pow","ppr","ppl","pp33" 2 | "1",1,".1","",TRUE,"r",24,NA,1.31710554819635,1.2755127414112,26,0.55,0.00360407531761852,0.00180203765880926,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.62569004111409,0.229390681003584,0.4789474720714,2.91088422817956,0.82917756772308,0.82917756772308,0.0720815063523705,0.927918493647629,0.782466903131448 3 | "2",2,".2","",TRUE,"r",21,NA,1.00780651972054,0.971379778043892,23,0.45,0.0311965812500361,0.0155982906250181,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.46744676548987,0.227985180963237,0.477477937671718,2.15455617969051,0.577143893186187,0.577143893186187,0.623931625000722,0.376068374999278,0.217796977829189 4 | "3",3,".3","",TRUE,"t",72,NA,1.13137084989848,1.11954467376713,74,4.8,8.35717690715014e-06,4.17858845357507e-06,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-11.6923898784302,0.0627027027027027,0.25040507723028,4.45582350015752,0.993717382306396,0.993717382306396,0.000167143538143399,0.999832856461857,0.99613676861413 5 | "4",4,".4","",TRUE,"f",1,40,0.707106781186547,0.693765143805669,42,5,0.0309924607128595,0.0154962303564298,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.47401130688657,0.101190476190476,0.318104505140176,2.15716949070589,0.578166639034966,0.578166639034966,0.619849214257191,0.380150785742809,0.213926089890086 6 | "5",5,".5","",TRUE,"f",1,48,0.788458411500991,0.776074247969562,50,7.46,0.00879913945031573,0.00439956972515786,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.73310135201655,0.0862166666666667,0.293626747192191,2.61976106247763,0.745307970624029,0.745307970624029,0.175982789006315,0.824017210993685,0.604610782657955 7 | "6",6,".6","",TRUE,"t",131,NA,0.438599436443841,0.436083569695597,133,2.51,0.0132910922918141,0.00664554614590705,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.320661220634,0.0307983814498077,0.175494676414436,2.47587279602212,0.697040950212269,0.697040950212269,0.265821845836283,0.734178154163717,0.491182666588346 8 | "7",7,".7","",TRUE,"t",131,NA,0.393166825497467,0.390911566460197,133,2.25,0.0261168387751227,0.0130584193875613,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.64517500888438,0.0306563163634277,0.175089452461956,2.22446999974079,0.604304984819912,0.604304984819912,0.522336775502454,0.477663224497546,0.273980322296265 9 | "8",8,".8","",TRUE,"t",29,NA,0.805917767688405,0.784893825922621,31,2.17,0.0383397639770765,0.0191698819885383,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.26126769743271,0.139508120133482,0.373507858195088,2.07120370007826,0.544286870697626,0.544286870697626,0.766795279541528,0.233204720458472,0.125039608609917 10 | "9",9,".9","",TRUE,"t",40,NA,0.825354469303947,0.809781743468023,42,2.61,0.0126787848554428,0.00633939242772139,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.36782516615488,0.103347738095238,0.321477430149051,2.49266656165906,0.702880259048569,0.702880259048569,0.253575697108857,0.746424302891143,0.515629960683949 11 | "10",10,".10","",TRUE,"t",110,NA,1.16131743370113,1.15338132367584,112,6.09,1.69209997088078e-08,8.46049985440388e-09,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-17.8947104000688,0.0417350811688312,0.204291657119989,5.64085277918162,0.999883788818096,0.999883788818096,1e-05,0.99999,0.999961882529907 12 | "11",11,".11","",TRUE,"t",94,NA,1.056175356169,1.04772595331965,96,5.12,1.61818787419967e-06,8.09093937099835e-07,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-13.3342036309887,0.0474765957446808,0.217891247517382,4.79605757533483,0.997716546956351,0.997716546956351,3.23637574872748e-05,0.999967636242513,0.998779821611614 13 | "12",12,".12","",TRUE,"f",1,87,0.419084936388849,0.415461723682318,89,3.82,0.0538557154894872,0.0269278577447436,"",0.05,FALSE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-2.92144674378836,0.0459305178871239,0.214314063670875,1.92799526215487,0.487248497031451,0.487248497031451,NA,NA,NA 14 | "13",13,".13","",TRUE,"f",1,68,0.646256186681048,0.639102059153213,70,7.1,0.00961854088426485,0.00480927044213242,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.64406270104072,0.0601260504201681,0.245206138626601,2.58924938143763,0.735418885034372,0.735418885034372,0.192370817685297,0.807629182314703,0.579411069007791 15 | "14",14,".14","",TRUE,"f",1,71,0.521644204469232,0.51611440724871,73,4.83,0.0312315030469807,0.0156157515234903,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.46632798053978,0.0566583060003859,0.238030052725251,2.15411055431263,0.576969441057547,0.576969441057547,0.624630060939615,0.375369939060385,0.207513129149035 16 | "15",15,".15","",TRUE,"f",1,93,0.523429550774176,0.519196966805652,95,6.37,0.0133022084500757,0.00665110422503787,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.31982520866114,0.0435472552348613,0.208679791151087,2.47557428865539,0.696936693930562,0.696936693930562,0.266044169001516,0.733955830998484,0.49343168837509 17 | "16",16,".16","",TRUE,"f",1,94,0.44098535702037,0.437457474164207,96,4.57,0.0351308175301616,0.0175654087650808,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.34867654140781,0.0426795212765957,0.206590225510782,2.10684730486995,0.558387941216862,0.558387941216862,0.702616350603231,0.297383649396769,0.158270246095359 18 | "17",18,".17","",TRUE,"f",1,101,0.413150177667795,0.410074618032551,103,4.31,0.0404286253060717,0.0202143126530359,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.20821719773608,0.0396635585888686,0.19915712035694,2.04934260505402,0.53560949309077,0.53560949309077,0.808572506121434,0.191427493878566,0.0976569262926101 19 | "18",20,".18","",TRUE,"f",1,58,0.737189443672431,0.727615554793569,60,7.88,0.00679646396319998,0.00339823198159999,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.99135280746155,0.0711954022988506,0.26682466583667,2.70665601217701,0.772375258398578,0.772375258398578,0.135929279264,0.864070720736,0.657123186618877 20 | "19",23,".19","",TRUE,"f",1,148,0.574691456583679,0.571774241068026,150,12.22,0.000624218847119088,0.000312109423559544,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-7.37900953454452,0.0277675675675676,0.166636033220812,3.42086685229699,0.927978950242731,0.927978950242731,0.012484376942381,0.987515623057619,0.917176335624655 21 | "20",24,".20","",TRUE,"f",1,144,0.344399638662864,0.342602770982884,146,4.27,0.0405824480926305,0.0202912240463153,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.20441961883805,0.0278034627092846,0.166743703657094,2.04777094977314,0.534984949152145,0.534984949152145,0.811648961852611,0.188351038147389,0.0955611797867638 22 | "21",25,".21","",TRUE,"f",1,57,0.566924605897407,0.559432210224754,59,4.58,0.0366399054451497,0.0183199527225749,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.30661731982501,0.0705203687184062,0.265556714692749,2.08975397783224,0.551633709929254,0.551633709929254,0.732798108902994,0.267201891097006,0.141913104513516 23 | "22",26,".22","",TRUE,"f",1,74,0.549200893682468,0.543615799848409,76,5.58,0.0207981732110946,0.0103990866055473,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.87289012252151,0.0546159317211949,0.233700517160735,2.31162834511492,0.637455004258161,0.637455004258161,0.415963464221893,0.584036535778107,0.357805981814757 24 | "23",27,".23","",TRUE,"f",1,114,0.505756338254115,0.502421681078813,116,7.29,0.00799037289180682,0.00399518644590341,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.82951785047984,0.0355852994555354,0.188640662253755,2.65247633493292,0.755692183679693,0.755692183679693,0.159807457836136,0.840192542163864,0.617027645455561 25 | "24",28,".24","",TRUE,"f",1,52,0.603833904824319,0.595082688812372,54,4.74,0.0340305629599248,0.0170152814799624,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.38049624755812,0.0774501424501425,0.278298656931977,2.11970936239737,0.563459173243494,0.563459173243494,0.680611259198498,0.319388740801502,0.173682546013417 26 | "25",29,".25","",TRUE,"f",1,177,0.466262940778594,0.464284455881372,179,9.62,0.00224038070549626,0.00112019035274813,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-6.10110946974555,0.022953634441183,0.151504569043917,3.05636536542108,0.863548420032635,0.863548420032635,0.0448076141099252,0.955192385890075,0.815997368233336 27 | "26",30,".26","",TRUE,"f",1,98,0.440315285926355,0.436936907773468,100,4.75,0.0316941780811593,0.0158470890405797,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.45162227171163,0.040969387755102,0.202408961647211,2.14824650515707,0.574672406582344,0.574672406582344,0.633883561623185,0.366116438376815,0.200447965782009 28 | "27",31,".27","",TRUE,"f",1,102,0.597708040736265,0.593302330362287,104,9.11,0.0032110006079154,0.0016055003039577,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.74117267455201,0.0401791101055807,0.200447275126355,2.94678144777489,0.838133933958407,0.838133933958407,0.064220012158307,0.935779987841693,0.775208294097308 29 | "28",32,".28","",TRUE,"f",1,210,0.290483996772546,0.289445317403872,212,4.43,0.0365016516870469,0.0182508258435234,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.3103977677176,0.0190669362084456,0.138083077197916,2.09129473290601,0.552243165619191,0.552243165619191,0.730033033740938,0.269966966259062,0.140880705340051 30 | "29",33,".29","",TRUE,"f",1,166,0.39849113004293,0.396688002757668,168,6.59,0.0111378993754398,0.00556894968771991,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.49740162820277,0.0242821285140562,0.155827239319883,2.53834227860733,0.718495627385032,0.718495627385032,0.222757987508797,0.777242012491203,0.537204665768733 31 | "30",34,".30","",TRUE,"f",1,105,0.570379990298865,0.566296124019876,107,8.54,0.00425487784276655,0.00212743892138328,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.45968922647196,0.0389034267912773,0.197239516302584,2.85862026791273,0.815582115302661,0.815582115302661,0.0850975568553314,0.914902443144669,0.734133155930902 32 | "31",35,".31","",TRUE,"f",1,136,0.344281006976432,0.342378901965512,138,4.03,0.0466794181908717,0.0233397090954358,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.06445193541884,0.0294149616368286,0.171507905464526,1.98919740541028,0.511660786691341,0.511660786691341,0.933588363817432,0.0664116361825675,0.032288090732339 33 | "32",41,".32","",TRUE,"f",1,40,0.689202437604511,0.676198618027068,42,4.75,0.0352452734776854,0.0176226367388427,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.34542384445358,0.100892857142857,0.317636359919417,2.10552914035412,0.55786766171974,0.55786766171974,0.704905469553707,0.295094530446293,0.16020561030283 34 | "33",42,".33","",TRUE,"f",1,33,1.03747946310452,1.01372039143037,35,8.88,0.00537703944999096,0.00268851972499548,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.22561734437828,0.129662337662338,0.360086569677817,2.78353298645071,0.794907752419558,0.794907752419558,0.10754078899982,0.89245921100018,0.711103035779388 35 | "34",43,".34","",TRUE,"f",1,87,0.677724387068656,0.671865098419648,89,9.99,0.00216609583598695,0.00108304791799348,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-6.13482888577413,0.0475242154203797,0.21800049408288,3.06646028266952,0.865744117290527,0.865744117290527,0.0433219167197407,0.956678083280259,0.824033629578809 36 | "35",44,".35","",TRUE,"f",1,38,0.948128350183166,0.929291363093434,40,8.54,0.00582192175893804,0.00291096087946902,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.14612487261228,0.111236842105263,0.333521876501772,2.75764594685673,0.787472463058218,0.787472463058218,0.116438435178761,0.883561564821239,0.693749551672917 37 | "36",45,".36","",TRUE,"f",1,64,0.73357003755606,0.724939801820107,66,8.61,0.00463695846776365,0.00231847923388182,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.3736966303169,0.0646827651515152,0.254328065992558,2.83122847836673,0.808195123717305,0.808195123717305,0.0927391693552737,0.907260830644726,0.725150196897885 38 | "37",46,".37","",TRUE,"t",112,NA,0.370405183549043,0.367919242719854,114,1.96,0.0524797674224698,0.0262398837112349,"",0.05,FALSE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-2.9473275660926,0.0356894736842105,0.188916578637796,1.93917717912819,0.491707861611144,0.491707861611144,NA,NA,NA 39 | "38",47,".38","",TRUE,"t",119,NA,0.627021771967297,0.623061634460135,121,3.42,0.000858512387186752,0.000429256193593376,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-7.06030944885868,0.0346824640600042,0.186232285224674,3.33320636606345,0.915161495880609,0.915161495880609,0.0171702477437341,0.982829752256266,0.899501014219001 40 | "39",48,".39","",TRUE,"t",44,NA,0.557795987468863,0.548233770540825,46,1.85,0.0710363047415143,0.0355181523707572,"",0.05,FALSE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-2.64456419824018,0.0903384387351779,0.300563535271959,1.8052453022587,0.438521550508933,0.438521550508933,NA,NA,NA 41 | -------------------------------------------------------------------------------- /PET-PEESE test/load.R: -------------------------------------------------------------------------------- 1 | TBL <- read.csv("input_data.csv") -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # p-checker: The one-for-all p-value analyzer. 2 | 3 | This Shiny app code implements the **p-curve** (Simonsohn, Nelson, & Simmons, 2013; see http://www.p-curve.com), the **R-Index**, the **Test of Insufficient Variance, TIVA** (Schimmack, 2014; see http://www.r-index.org/), and checks whether p-values are reported correctly. 4 | 5 | Some code is adapted from Uri Simonsohn (http://www.p-curve.com/Supplement/R/). 6 | 7 | The currect stable app is at (http://shinyapps.org/apps/p-checker/). 8 | 9 | ## Known issues: 10 | - TODO: Clearly separate the inference functions from UI functions 11 | - TODO: Make TIVA computation robust against outliers 12 | - TODO: Make the code prettier, add a lot of annotations -------------------------------------------------------------------------------- /TIVA.R: -------------------------------------------------------------------------------- 1 | # TIVA = Test of insufficient variance - see https://replicationindex.wordpress.com/2014/12/30/the-test-of-insufficient-variance-tiva-a-new-tool-for-the-detection-of-questionable-research-practices/ 2 | # code adapted from Moritz Heene 3 | 4 | # This function assumes *one-tailed* p-values that all are directionally consistent! 5 | TIVA <- function (p.values, log.p=FALSE) { 6 | if (log.p==FALSE) { 7 | p.values <- clamp(p.values, MIN=.000000001, MAX=1-.000000001) # prevent infinite z-values 8 | z.values <- qnorm(p.values, lower.tail = FALSE) 9 | } else { 10 | z.values <- qnorm(p.values, lower.tail = FALSE, log.p=TRUE) 11 | } 12 | var.z <- var(z.values) 13 | df <- length(p.values)-1 14 | chi.square <- df*var.z 15 | chi.p <- pchisq(chi.square, df=df, lower.tail = TRUE) 16 | data.frame(var.z=var.z, chi2=chi.square, df=df, p.value=chi.p) 17 | } 18 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | - ES computation based on BS/WS 2 | - Show meta-warnings in meta-tab -------------------------------------------------------------------------------- /demo-data/855_t_tests.txt: -------------------------------------------------------------------------------- 1 | #' @title 855 t-tests 2 | #' @subtitle by Ruud Wetzels et al. 3 | #' @details Wetzels, R., Matzke, D., Lee, M. D., Rouder, J. N., Iverson, G. J., & Wagenmakers, E.-J. (2011). Statistical evidence in experimental psychology: An empirical comparison using 855 t tests. Perspectives on Psychological Science, 6, 291–298. doi:10.1177/1745691611406923 4 | #' @url http://www.ejwagenmakers.com/2011/effectsize_data.zip 5 | 6 | t(17)=0.75 7 | t(12)=3.52 8 | t(13)=2.42 9 | t(15)=3.76 10 | t(26)=2.724 11 | t(13)=2.57 12 | t(15)=2.04 13 | t(3)=1.85 14 | t(3)=-8.46 15 | t(3)=9.94 16 | t(13)=2.58 17 | t(10)=2.91 18 | t(11)=5.58 19 | t(11)=5.58 20 | t(11)=5.12 21 | t(11)=2.43 22 | t(11)=2.83 23 | t(11)=2.49 24 | t(17)=2.05 25 | t(17)=3.07 26 | t(17)=3.57 27 | t(17)=3.91 28 | t(25)=2.38 29 | t(25)=1.25 30 | t(22)=4.12 31 | t(20)=9.73 32 | t(43)=2.44 33 | t(15)=0.48 34 | t(35)=10.58 35 | t(35)=9.63 36 | t(35)=2.17 37 | t(35)=6.64 38 | t(35)=5.95 39 | t(35)=2.07 40 | t(10)=12 41 | t(10)=0.446 42 | t(11)=3.46 43 | t(11)=0.93 44 | t(11)=5.05 45 | t(71)=2.86 46 | t(19)=2.51 47 | t(19)=5.73 48 | t(19)=1.33 49 | t(19)=3.82 50 | t(19)=4.512 51 | t(19)=0.802 52 | t(14)=2.807 53 | t(19)=6.447 54 | t(19)=9.828 55 | t(19)=5.435 56 | t(19)=2.084 57 | t(14)=3.522 58 | t(14)=7.776 59 | t(14)=2.256 60 | t(14)=1.653 61 | t(14)=0.901 62 | t(14)=1.449 63 | t(14)=0.494 64 | t(14)=2.185 65 | t(19)=3.084 66 | t(19)=6.9 67 | t(19)=-3.157 68 | t(19)=-3.642 69 | t(19)=3.39 70 | t(19)=3.96 71 | t(19)=2.9 72 | t(19)=0.36 73 | t(26)=2.37 74 | t(26)=2.96 75 | t(26)=0.11 76 | t(26)=0.13 77 | t(23)=4.14 78 | t(23)=3.89 79 | t(23)=2.8 80 | t(23)=2.81 81 | t(29)=3.04 82 | t(29)=2.52 83 | t(29)=3.45 84 | t(29)=1.15 85 | t(29)=2.24 86 | t(8)=9.24 87 | t(8)=3.6 88 | t(93)=5.58 89 | t(19)=-4.45 90 | t(19)=-4.43 91 | t(62)=3.53 92 | t(62)=2.96 93 | t(24)=1.4 94 | t(24)=1.5 95 | t(38)=1.76 96 | t(38)=2.1 97 | t(38)=-3.27 98 | t(38)=-2.34 99 | t(38)=-3.147 100 | t(38)=-2.84 101 | t(38)=2.5 102 | t(38)=2 103 | t(118)=1.85 104 | t(118)=4.4 105 | t(118)=3.62 106 | t(118)=2.64 107 | t(98)=6.25 108 | t(98)=6.69 109 | t(98)=6.35 110 | t(98)=5.21 111 | t(98)=6.59 112 | t(98)=4.2 113 | t(98)=7.13 114 | t(98)=1.76 115 | t(98)=6.64 116 | t(98)=3.98 117 | t(98)=1.74 118 | t(98)=2.15 119 | t(22)=2.35 120 | t(30)=1.07 121 | t(34)=3.89 122 | t(34)=1.68 123 | t(28)=-5.02 124 | t(18)=-9.3 125 | t(50)=0.36 126 | t(50)=2.98 127 | t(50)=0.44 128 | t(58)=9.39 129 | t(58)=3.16 130 | t(58)=2.11 131 | t(58)=2.21 132 | t(58)=1.29 133 | t(70)=2.37 134 | t(70)=2.63 135 | t(70)=2.4 136 | t(70)=1.5 137 | t(70)=1.65 138 | t(50)=0.68 139 | t(46)=3.42 140 | t(46)=2.07 141 | t(46)=3.49 142 | t(46)=2.39 143 | t(46)=3.37 144 | t(46)=1.95 145 | t(94)=4.74 146 | t(94)=3.94 147 | t(94)=3.49 148 | t(94)=2.95 149 | t(46)=3.99 150 | t(46)=2.39 151 | t(46)=2.09 152 | t(46)=2.02 153 | t(70)=3.074 154 | t(62)=0.55 155 | t(62)=1.91 156 | t(62)=0.37 157 | t(62)=1.03 158 | t(62)=2.63 159 | t(62)=0.93 160 | t(86)=2.17 161 | t(150)=1.66 162 | t(86)=2.45 163 | t(28)=0.455 164 | t(106)=2.4 165 | t(106)=2.7 166 | t(106)=3.9 167 | t(106)=3.2 168 | t(46)=5.22 169 | t(46)=12.86 170 | t(46)=7.9 171 | t(46)=13.6 172 | t(42)=1.86 173 | t(42)=3.14 174 | t(30)=3.78 175 | t(38)=3.78 176 | t(38)=3.55 177 | t(38)=2.54 178 | t(38)=3.28 179 | t(38)=3.987 180 | t(38)=9.005 181 | t(38)=7.127 182 | t(38)=2.54 183 | t(38)=2.862 184 | t(38)=2.37 185 | t(28)=2.239 186 | t(28)=0.105 187 | t(28)=2.446 188 | t(28)=6.392 189 | t(28)=2.134 190 | t(38)=3.199 191 | t(38)=1.267 192 | t(38)=-1.02 193 | t(70)=-1.04 194 | t(4)=2.58 195 | t(4)=5.27 196 | t(4)=2.71 197 | t(34)=0.66 198 | t(34)=1.99 199 | t(34)=4.29 200 | t(34)=4.34 201 | t(34)=4.46 202 | t(11)=2.09 203 | t(11)=1.89 204 | t(87)=2.29 205 | t(87)=2.85 206 | t(62)=3.32 207 | t(62)=1.27 208 | t(62)=25.63 209 | t(128)=2.3 210 | t(43)=2.35 211 | t(43)=2.21 212 | t(23)=2.72 213 | t(26)=0.2 214 | t(44)=2.2 215 | t(44)=5.22 216 | t(44)=5.93 217 | t(47)=6.15 218 | t(47)=12.43 219 | t(44)=3.75 220 | t(44)=7.18 221 | t(45)=5.11 222 | t(45)=6.19 223 | t(44)=2.61 224 | t(44)=7.5 225 | t(44)=2.05 226 | t(44)=2.79 227 | t(44)=3.91 228 | t(44)=7.63 229 | t(361)=12.7 230 | t(361)=8.8 231 | t(61)=2.05 232 | t(44)=2.76 233 | t(69)=2.12 234 | t(69)=2.33 235 | t(93)=4.34 236 | t(93)=2.17 237 | t(69)=0.45 238 | t(22)=1.89 239 | t(22)=3.62 240 | t(23)=2.76 241 | t(23)=2.76 242 | t(46)=1.76 243 | t(46)=2.38 244 | t(22)=1.63 245 | t(22)=1.2 246 | t(37)=1.58 247 | t(27)=1.84 248 | t(14)=1.41 249 | t(6)=3.11 250 | t(9)=1.84 251 | t(12)=2.48 252 | t(8)=6.49 253 | t(14)=1.66 254 | t(12)=3.55 255 | t(8)=3.05 256 | t(23)=4.63 257 | t(11)=20.61 258 | t(19)=3.67 259 | t(19)=3.24 260 | t(27)=3.05 261 | t(27)=0.638 262 | t(27)=0.044 263 | t(35)=2.67 264 | t(35)=-0.485 265 | t(35)=-3.31 266 | t(43)=2.12 267 | t(43)=3.58 268 | t(43)=-0.39 269 | t(43)=1.52 270 | t(43)=0.49 271 | t(43)=0.47 272 | t(17)=7.87 273 | t(17)=9.22 274 | t(27)=7 275 | t(19)=5.35 276 | t(19)=6.67 277 | t(15)=2.95 278 | t(15)=2.9 279 | t(22)=8.12 280 | t(22)=1.28 281 | t(14)=7.09 282 | t(14)=1.55 283 | t(29)=4.86 284 | t(19)=2.97 285 | t(19)=2.22 286 | t(19)=2.1 287 | t(19)=-0.65 288 | t(19)=0.51 289 | t(19)=0 290 | t(22)=1.24 291 | t(22)=-1.49 292 | t(8)=2.61 293 | t(8)=3.13 294 | t(8)=0.56 295 | t(9)=5.8 296 | t(9)=2.95 297 | t(9)=0.78 298 | t(111)=23.86 299 | t(90)=16.95 300 | t(111)=3.24 301 | t(90)=0.44 302 | t(60)=2.5 303 | t(60)=7.5 304 | t(60)=10.5 305 | t(60)=4.2 306 | t(60)=6.76 307 | t(60)=2.4 308 | t(15)=-8.43 309 | t(15)=-1.145 310 | t(15)=-4.65 311 | t(15)=-2.926 312 | t(15)=-1.01 313 | t(15)=-3.84 314 | t(37)=1.12 315 | t(14)=2.22 316 | t(18)=2.27 317 | t(18)=0.829 318 | t(19)=12 319 | t(19)=13.8 320 | t(19)=2.5 321 | t(19)=10.4 322 | t(19)=12.1 323 | t(19)=1.1 324 | t(19)=7.2 325 | t(19)=10.9 326 | t(19)=2.8 327 | t(19)=10.3 328 | t(19)=10.1 329 | t(19)=2.53 330 | t(19)=5 331 | t(19)=4.8 332 | t(19)=0.3 333 | t(20)=1.715 334 | t(20)=2.01 335 | t(20)=3.48 336 | t(20)=0.4 337 | t(20)=0.3 338 | t(11)=4.66 339 | t(11)=4.3 340 | t(11)=3.312 341 | t(11)=2.72 342 | t(11)=1.17 343 | t(11)=1.41 344 | t(31)=2.1 345 | t(21)=1 346 | t(21)=1.4 347 | t(21)=2.13 348 | t(21)=0.11 349 | t(21)=3.13 350 | t(21)=2.3 351 | t(21)=2.3 352 | t(21)=2.8 353 | t(21)=4.19 354 | t(21)=0.14 355 | t(21)=2.82 356 | t(129)=2.99 357 | t(19)=3.22 358 | t(7)=4.29 359 | t(19)=2.92 360 | t(7)=3.87 361 | t(19)=3.22 362 | t(7)=3.06 363 | t(19)=3.01 364 | t(7)=6.25 365 | t(19)=3.01 366 | t(7)=2.76 367 | t(19)=4.92 368 | t(7)=2.77 369 | t(19)=5.7 370 | t(19)=4.87 371 | t(19)=7.27 372 | t(19)=6.79 373 | t(19)=6.34 374 | t(19)=6.24 375 | t(19)=7.11 376 | t(19)=7.43 377 | t(19)=3.87 378 | t(19)=0.09 379 | t(19)=2.6 380 | t(19)=0.52 381 | t(19)=5.5 382 | t(19)=0.49 383 | t(19)=2.26 384 | t(19)=1.93 385 | t(26)=3.64 386 | t(11)=5.66 387 | t(15)=3.41 388 | t(15)=2.17 389 | t(22)=3.39 390 | t(21)=1.91 391 | t(21)=4.35 392 | t(22)=5.98 393 | t(22)=3.56 394 | t(21)=4.6 395 | t(22)=3.09 396 | t(21)=5.04 397 | t(22)=4.95 398 | t(23)=6.39 399 | t(23)=9.7 400 | t(23)=2.86 401 | t(23)=2.63 402 | t(23)=4.7 403 | t(23)=7.79 404 | t(23)=3.63 405 | t(23)=2.68 406 | t(17)=1.77 407 | t(14)=3 408 | t(19)=3.4 409 | t(19)=2.73 410 | t(19)=5.09 411 | t(19)=3.4 412 | t(19)=5.03 413 | t(19)=2.43 414 | t(19)=5.92 415 | t(19)=4.15 416 | t(19)=6.5 417 | t(19)=3.9 418 | t(19)=4.19 419 | t(19)=4.5 420 | t(19)=3.69 421 | t(19)=4.3 422 | t(19)=5.44 423 | t(47)=5.41 424 | t(47)=2.69 425 | t(47)=5.7 426 | t(47)=1.94 427 | t(47)=4.86 428 | t(47)=3.38 429 | t(47)=5.65 430 | t(47)=4 431 | t(47)=2.15 432 | t(47)=2.84 433 | t(20)=4.14 434 | t(20)=6.04 435 | t(20)=2.36 436 | t(20)=1.89 437 | t(20)=2.03 438 | t(20)=2.22 439 | t(20)=3.99 440 | t(20)=1.94 441 | t(20)=1.36 442 | t(20)=0.85 443 | t(20)=2.22 444 | t(20)=0.9 445 | t(20)=-0.44 446 | t(20)=1.11 447 | t(20)=-0.11 448 | t(20)=0.35 449 | t(21)=2.54 450 | t(21)=1.87 451 | t(21)=1.06 452 | t(20)=2.03 453 | t(21)=1.37 454 | t(21)=0.7 455 | t(20)=0.43 456 | t(21)=1.2 457 | t(21)=0.89 458 | t(21)=0.31 459 | t(49)=2.11 460 | t(49)=2.54 461 | t(49)=1.46 462 | t(19)=3 463 | t(11)=3.57 464 | t(7)=4.47 465 | t(15)=2.13 466 | t(29)=2.75 467 | t(29)=1.5 468 | t(27)=3.34 469 | t(23)=4.53 470 | t(27)=5.32 471 | t(23)=4.09 472 | t(27)=3.95 473 | t(23)=1.39 474 | t(27)=3.46 475 | t(23)=2 476 | t(27)=2.99 477 | t(23)=1.71 478 | t(27)=2.27 479 | t(27)=1.68 480 | t(23)=1.24 481 | t(12)=1.86 482 | t(20)=4.1 483 | t(20)=5.6 484 | t(20)=2.9 485 | t(20)=3.7 486 | t(20)=4.36 487 | t(7)=11.72 488 | t(27)=8.03 489 | t(29)=4.54 490 | t(38)=4.25 491 | t(38)=0.3 492 | t(19)=3.55 493 | t(15)=3.71 494 | t(15)=2.77 495 | t(15)=3.6 496 | t(19)=1.28 497 | t(19)=11.19 498 | t(19)=6.43 499 | t(11)=9.43 500 | t(11)=4.71 501 | t(15)=3.832 502 | t(15)=1.837 503 | t(15)=4.87 504 | t(15)=2.955 505 | t(15)=2.682 506 | t(15)=2.308 507 | t(15)=-1.78 508 | t(52)=5.47 509 | t(24)=5.62 510 | t(27)=6.2 511 | t(45)=7.36 512 | t(45)=4.15 513 | t(45)=3.94 514 | t(11)=-1.9 515 | t(52)=8.53 516 | t(52)=2.94 517 | t(13)=1.2 518 | t(15)=1.8 519 | t(23)=0.001 520 | t(23)=2.56 521 | t(43)=1.22 522 | t(43)=2.04 523 | t(25)=6.48 524 | t(25)=2.08 525 | t(35)=1.96 526 | t(35)=2.53 527 | t(9)=5.06 528 | t(9)=3.28 529 | t(9)=3.09 530 | t(9)=6.7 531 | t(43)=2.34 532 | t(23)=1.22 533 | t(23)=1.26 534 | t(23)=2.33 535 | t(23)=3.57 536 | t(23)=3.43 537 | t(23)=0.797 538 | t(23)=3.78 539 | t(23)=0.97 540 | t(23)=0.44 541 | t(23)=3.27 542 | t(23)=10.45 543 | t(23)=12.15 544 | t(23)=4.41 545 | t(23)=6.88 546 | t(19)=2.81 547 | t(19)=0.88 548 | t(51)=1.2 549 | t(51)=2.85 550 | t(51)=4.47 551 | t(51)=4.1 552 | t(51)=1.31 553 | t(51)=2.02 554 | t(29)=1.39 555 | t(35)=4 556 | t(35)=2.3 557 | t(35)=2.3 558 | t(29)=4 559 | t(29)=1.3 560 | t(29)=4 561 | t(29)=1.3 562 | t(29)=0.53 563 | t(29)=1.73 564 | t(9)=5.079 565 | t(9)=4.194 566 | t(44)=-1.18 567 | t(44)=2.44 568 | t(11)=2.31 569 | t(31)=0.75 570 | t(31)=0.6 571 | t(23)=2.09 572 | t(23)=6.01 573 | t(23)=2.37 574 | t(23)=4.72 575 | t(31)=1.57 576 | t(31)=0.06 577 | t(31)=1.16 578 | t(31)=4.61 579 | t(30)=1.18 580 | t(30)=1.95 581 | t(21)=0.64 582 | t(21)=4.03 583 | t(25)=0.29 584 | t(25)=2.29 585 | t(25)=0.21 586 | t(25)=1.79 587 | t(23)=1.26 588 | t(23)=1.16 589 | t(23)=0.6 590 | t(23)=1.57 591 | t(24)=0.009 592 | t(24)=1.08 593 | t(23)=0.92 594 | t(23)=1.55 595 | t(21)=0.43 596 | t(21)=2.46 597 | t(11)=0.43 598 | t(17)=2.13 599 | t(17)=0.47 600 | t(42)=1.96 601 | t(19)=3.19 602 | t(25)=1.33 603 | t(19)=3.85 604 | t(22)=2.8 605 | t(46)=3.03 606 | t(94)=3.33 607 | t(94)=2.51 608 | t(56)=0.68 609 | t(28)=2.6 610 | t(29)=3.5 611 | t(28)=2.7 612 | t(29)=2.3 613 | t(28)=2.8 614 | t(29)=1.6 615 | t(28)=4.5 616 | t(29)=1.8 617 | t(22)=3.3 618 | t(24)=3 619 | t(29)=3.4 620 | t(119)=2.8 621 | t(19)=2.51 622 | t(19)=1.6 623 | t(19)=2.1 624 | t(19)=1.7 625 | t(19)=5.5 626 | t(19)=4.9 627 | t(19)=4.2 628 | t(19)=4.4 629 | t(31)=3 630 | t(23)=2.4 631 | t(31)=1.72 632 | t(23)=2.12 633 | t(35)=3.3 634 | t(35)=2.5 635 | t(35)=3.8 636 | t(35)=2 637 | t(35)=3.18 638 | t(23)=2.48 639 | t(35)=3.75 640 | t(23)=2.49 641 | t(35)=2.82 642 | t(23)=2.77 643 | t(35)=4.07 644 | t(23)=3.64 645 | t(35)=2 646 | t(23)=1.25 647 | t(35)=2.87 648 | t(23)=2.27 649 | t(35)=3.17 650 | t(23)=2.16 651 | t(35)=2.59 652 | t(23)=1.86 653 | t(35)=1.88 654 | t(23)=2.11 655 | t(35)=3.67 656 | t(23)=3.01 657 | t(35)=2.25 658 | t(23)=1.45 659 | t(35)=3.21 660 | t(23)=3.01 661 | t(35)=2.93 662 | t(23)=3.47 663 | t(35)=3.61 664 | t(23)=5.24 665 | t(35)=1.74 666 | t(23)=1.94 667 | t(35)=2.95 668 | t(23)=4.7 669 | t(35)=3.48 670 | t(23)=5.01 671 | t(29)=1.3 672 | t(11)=1.42 673 | t(23)=11.87 674 | t(23)=13.45 675 | t(23)=2.71 676 | t(23)=3.07 677 | t(29)=2.4 678 | t(24)=4.1 679 | t(29)=3.5 680 | t(24)=5.7 681 | t(29)=3.1 682 | t(24)=3.2 683 | t(29)=2.2 684 | t(24)=3.8 685 | t(29)=2.2 686 | t(24)=3.6 687 | t(29)=1.7 688 | t(24)=3.4 689 | t(29)=1.6 690 | t(24)=2.3 691 | t(23)=3.16 692 | t(23)=-1.65 693 | t(24)=1.22 694 | t(24)=0.19 695 | t(25)=5.09 696 | t(25)=1.04 697 | t(23)=0.59 698 | t(23)=1.14 699 | t(24)=2.62 700 | t(24)=1.93 701 | t(24)=1.23 702 | t(24)=1.24 703 | t(23)=1.44 704 | t(23)=1.42 705 | t(23)=2.51 706 | t(23)=2.72 707 | t(23)=1.23 708 | t(23)=2.21 709 | t(23)=2.72 710 | t(23)=4.91 711 | t(23)=2.19 712 | t(23)=1.45 713 | t(23)=3.02 714 | t(23)=3.24 715 | t(23)=2.5 716 | t(23)=3.24 717 | t(23)=1.4 718 | t(23)=3.31 719 | t(23)=3.38 720 | t(19)=3.2 721 | t(13)=1 722 | t(13)=2.13 723 | t(14)=2.79 724 | t(35)=0.81 725 | t(13)=-2.81 726 | t(21)=-1.73 727 | t(15)=2.22 728 | t(35)=0.51 729 | t(25)=2.2 730 | t(71)=3.06 731 | t(71)=2.06 732 | t(29)=0.22 733 | t(29)=2.06 734 | t(29)=1.77 735 | t(43)=0.34 736 | t(43)=10.51 737 | t(43)=10.83 738 | t(29)=0.41 739 | t(29)=6.14 740 | t(29)=5.06 741 | t(29)=3.73 742 | t(29)=7.24 743 | t(43)=7.62 744 | t(43)=3.24 745 | t(29)=2.96 746 | t(29)=4.44 747 | t(29)=3.56 748 | t(29)=1.51 749 | t(41)=3.27 750 | t(29)=6.4 751 | t(29)=3.7 752 | t(15)=2.26 753 | t(15)=0.2 754 | t(37)=3.33 755 | t(16)=2.37 756 | t(16)=1.18 757 | t(15)=2.53 758 | t(15)=0.49 759 | t(16)=0.53 760 | t(16)=2.88 761 | t(16)=2.14 762 | t(38)=0.45 763 | t(35)=1.62 764 | t(12)=1.17 765 | t(12)=3.71 766 | t(12)=0.17 767 | t(12)=3.66 768 | t(23)=2.92 769 | t(23)=3.13 770 | t(27)=2.39 771 | t(16)=3.63 772 | t(16)=3.46 773 | t(23)=2.47 774 | t(29)=0.86 775 | t(15)=0.97 776 | t(15)=0.86 777 | t(38)=-0.27 778 | t(31)=3.2 779 | t(31)=2.1 780 | t(47)=3.3 781 | t(47)=2.2 782 | t(23)=1.91 783 | t(23)=1.36 784 | t(23)=4.12 785 | t(23)=1.38 786 | t(23)=2.27 787 | t(23)=1.55 788 | t(23)=3.22 789 | t(23)=2.45 790 | t(23)=3.58 791 | t(23)=2.78 792 | t(18)=2.79 793 | t(18)=5.45 794 | t(20)=2.69 795 | t(21)=2.67 796 | t(29)=2.18 797 | t(29)=2.26 798 | t(29)=3.89 799 | t(26)=7.73 800 | t(23)=7.56 801 | t(29)=5.04 802 | t(29)=6.46 803 | t(19)=-4.21 804 | t(19)=-5.16 805 | t(19)=1.78 806 | t(19)=0.9 807 | t(19)=2.26 808 | t(19)=2.58 809 | t(15)=-3.2 810 | t(13)=1.97 811 | t(12)=1.18 812 | t(27)=-0.96 813 | t(23)=2.03 814 | t(16)=3.83 815 | t(16)=1.18 816 | t(16)=3.13 817 | t(16)=3.28 818 | t(16)=1.78 819 | t(29)=1.46 820 | t(24)=2.8 821 | t(20)=2.3 822 | t(15)=-2.54 823 | t(15)=-2.6 824 | t(15)=-1.97 825 | t(15)=3.13 826 | t(15)=2.01 827 | t(15)=2.52 828 | t(15)=0.33 829 | t(15)=11.35 830 | t(15)=5.9 831 | t(15)=-1.18 832 | t(15)=-0.78 833 | t(15)=13.21 834 | t(15)=8.71 835 | t(15)=-1.59 836 | t(15)=-1.37 837 | t(15)=2.73 838 | t(15)=-0.47 839 | t(35)=0.64 840 | t(119)=0.74 841 | t(35)=3.35 842 | t(35)=7.43 843 | t(119)=5.94 844 | t(35)=3.35 845 | t(119)=2.86 846 | t(35)=6.58 847 | t(119)=5.95 848 | t(35)=3.87 849 | t(119)=3.41 850 | t(37)=7.14 851 | t(37)=7.63 852 | t(37)=8.52 853 | t(37)=0.26 854 | t(31)=7.58 855 | t(37)=7.79 856 | t(37)=9.74 857 | t(37)=1.5 858 | t(19)=7.06 859 | t(19)=1.38 860 | t(19)=0.67 861 | -------------------------------------------------------------------------------- /demo-data/Bem2011.txt: -------------------------------------------------------------------------------- 1 | # Test statistics from Bem, D. J. (2001). Feeling the Future: Experimental Evidence for Anomalous Retroactive Influences on Cognition and Affect. JPSP, 100, 407-425. 2 | 3 | Bem (2011) S1: t(99)=2.51; p=.01; one-tailed 4 | Bem (2011) S2: t(149)=2.39; p=.009; one-tailed 5 | Bem (2011) S3: t(96)=2.55; p=.006; one-tailed 6 | Bem (2011) S4: t(98)=2.03; p=.023; one-tailed 7 | Bem (2011) S5: t(99)=2.23; p=.014; one-tailed 8 | Bem (2011) S6a: t(149)=1.80; p=.037; one-tailed 9 | Bem (2011) S6b: t(149)=1.77; p=.039; one-tailed 10 | Bem (2011) S7: t(199)=1.31; p=.096; one-tailed 11 | Bem (2011) S8: t(99)=1.92; p=.029; one-tailed 12 | Bem (2011) S9: t(49)=2.96, p=.002; one-tailed 13 | -------------------------------------------------------------------------------- /demo-data/H0_100x5.txt: -------------------------------------------------------------------------------- 1 | #' @title Simulated data from H0 2 | #' @subtitle by F. Schönbrodt 3 | #' @details Results are from H0 (no effect), only significant (i.e., false positive) results are published. 4 | 5 | 6 | H0_1 (2015) S1: t(48)=2.561 7 | H0_1 (2015) S2: t(48)=2.401 8 | H0_1 (2015) S3: t(48)=2.408 9 | H0_1 (2015) S4: t(48)=2.16 10 | H0_1 (2015) S5: t(48)=2.128 11 | H0_2 (2015) S1: t(48)=2.022 12 | H0_2 (2015) S2: t(48)=2.038 13 | H0_2 (2015) S3: t(48)=2.258 14 | H0_2 (2015) S4: t(48)=2.134 15 | H0_2 (2015) S5: t(48)=2.096 16 | H0_3 (2015) S1: t(48)=2.234 17 | H0_3 (2015) S2: t(48)=2.174 18 | H0_3 (2015) S3: t(48)=2.114 19 | H0_3 (2015) S4: t(48)=2.091 20 | H0_3 (2015) S5: t(48)=2.479 21 | H0_4 (2015) S1: t(48)=2.197 22 | H0_4 (2015) S2: t(48)=2.09 23 | H0_4 (2015) S3: t(48)=2.181 24 | H0_4 (2015) S4: t(48)=2.077 25 | H0_4 (2015) S5: t(48)=2.951 26 | H0_5 (2015) S1: t(48)=2.02 27 | H0_5 (2015) S2: t(48)=2.025 28 | H0_5 (2015) S3: t(48)=2.147 29 | H0_5 (2015) S4: t(48)=2.507 30 | H0_5 (2015) S5: t(48)=2.553 31 | H0_6 (2015) S1: t(48)=2.496 32 | H0_6 (2015) S2: t(48)=2.466 33 | H0_6 (2015) S3: t(48)=2.451 34 | H0_6 (2015) S4: t(48)=2.178 35 | H0_6 (2015) S5: t(48)=2.102 36 | H0_7 (2015) S1: t(48)=2.491 37 | H0_7 (2015) S2: t(48)=2.08 38 | H0_7 (2015) S3: t(48)=3.374 39 | H0_7 (2015) S4: t(48)=2.151 40 | H0_7 (2015) S5: t(48)=2.111 41 | H0_8 (2015) S1: t(48)=2.561 42 | H0_8 (2015) S2: t(48)=2.401 43 | H0_8 (2015) S3: t(48)=2.408 44 | H0_8 (2015) S4: t(48)=2.16 45 | H0_8 (2015) S5: t(48)=2.128 46 | H0_9 (2015) S1: t(48)=2.316 47 | H0_9 (2015) S2: t(48)=2.191 48 | H0_9 (2015) S3: t(48)=2.185 49 | H0_9 (2015) S4: t(48)=2.476 50 | H0_9 (2015) S5: t(48)=2.307 51 | H0_10 (2015) S1: t(48)=2.332 52 | H0_10 (2015) S2: t(48)=2.185 53 | H0_10 (2015) S3: t(48)=2.212 54 | H0_10 (2015) S4: t(48)=2.916 55 | H0_10 (2015) S5: t(48)=2.215 56 | H0_11 (2015) S1: t(48)=2.196 57 | H0_11 (2015) S2: t(48)=2.19 58 | H0_11 (2015) S3: t(48)=2.019 59 | H0_11 (2015) S4: t(48)=2.52 60 | H0_11 (2015) S5: t(48)=2.056 61 | H0_12 (2015) S1: t(48)=2.361 62 | H0_12 (2015) S2: t(48)=2.492 63 | H0_12 (2015) S3: t(48)=2.125 64 | H0_12 (2015) S4: t(48)=2.256 65 | H0_12 (2015) S5: t(48)=2.637 66 | H0_13 (2015) S1: t(48)=2.222 67 | H0_13 (2015) S2: t(48)=2.219 68 | H0_13 (2015) S3: t(48)=2.021 69 | H0_13 (2015) S4: t(48)=3.18 70 | H0_13 (2015) S5: t(48)=3.154 71 | H0_14 (2015) S1: t(48)=2.156 72 | H0_14 (2015) S2: t(48)=2.823 73 | H0_14 (2015) S3: t(48)=2.931 74 | H0_14 (2015) S4: t(48)=2.203 75 | H0_14 (2015) S5: t(48)=2.975 76 | H0_15 (2015) S1: t(48)=2.825 77 | H0_15 (2015) S2: t(48)=2.344 78 | H0_15 (2015) S3: t(48)=2.48 79 | H0_15 (2015) S4: t(48)=2.814 80 | H0_15 (2015) S5: t(48)=2.048 81 | H0_16 (2015) S1: t(48)=2.206 82 | H0_16 (2015) S2: t(48)=2.464 83 | H0_16 (2015) S3: t(48)=2.419 84 | H0_16 (2015) S4: t(48)=2.153 85 | H0_16 (2015) S5: t(48)=2.474 86 | H0_17 (2015) S1: t(48)=2.246 87 | H0_17 (2015) S2: t(48)=2.246 88 | H0_17 (2015) S3: t(48)=2.217 89 | H0_17 (2015) S4: t(48)=2.03 90 | H0_17 (2015) S5: t(48)=2.383 91 | H0_18 (2015) S1: t(48)=2.021 92 | H0_18 (2015) S2: t(48)=3.009 93 | H0_18 (2015) S3: t(48)=2.168 94 | H0_18 (2015) S4: t(48)=3.676 95 | H0_18 (2015) S5: t(48)=3.095 96 | H0_19 (2015) S1: t(48)=2.325 97 | H0_19 (2015) S2: t(48)=2.72 98 | H0_19 (2015) S3: t(48)=2.667 99 | H0_19 (2015) S4: t(48)=2.3 100 | H0_19 (2015) S5: t(48)=2.449 101 | H0_20 (2015) S1: t(48)=2.388 102 | H0_20 (2015) S2: t(48)=2.786 103 | H0_20 (2015) S3: t(48)=2.502 104 | H0_20 (2015) S4: t(48)=2.15 105 | H0_20 (2015) S5: t(48)=2.552 106 | -------------------------------------------------------------------------------- /demo-data/H0_hack_100x5.txt: -------------------------------------------------------------------------------- 1 | #' @title Simulated data from H0 + p-hacking 2 | #' @subtitle by F. Schönbrodt 3 | #' @details Results are from H0 (no effect), data are p-hacked with various techniques, only significant (i.e., false positive) results are published. 4 | 5 | hack_1 (2015) S1: t(64)=2.075 6 | hack_1 (2015) S2: t(66)=2.002 7 | hack_1 (2015) S3: t(84)=2.073 8 | hack_1 (2015) S4: t(60)=2.106 9 | hack_1 (2015) S5: t(54)=2.087 10 | hack_2 (2015) S1: t(88)=2.397 11 | hack_2 (2015) S2: t(58)=2.162 12 | hack_2 (2015) S3: t(54)=2.011 13 | hack_2 (2015) S4: t(70)=2.074 14 | hack_2 (2015) S5: t(54)=2.237 15 | hack_3 (2015) S1: t(74)=1.988 16 | hack_3 (2015) S2: t(52)=2.38 17 | hack_3 (2015) S3: t(56)=2.102 18 | hack_3 (2015) S4: t(50)=2.15 19 | hack_3 (2015) S5: t(64)=2.161 20 | hack_4 (2015) S1: t(52)=2.095 21 | hack_4 (2015) S2: t(64)=2.347 22 | hack_4 (2015) S3: t(64)=2.008 23 | hack_4 (2015) S4: t(54)=2.075 24 | hack_4 (2015) S5: t(86)=2.116 25 | hack_5 (2015) S1: t(50)=2.407 26 | hack_5 (2015) S2: t(54)=2.578 27 | hack_5 (2015) S3: t(50)=2.891 28 | hack_5 (2015) S4: t(92)=2.232 29 | hack_5 (2015) S5: t(50)=2.477 30 | hack_6 (2015) S1: t(86)=2.159 31 | hack_6 (2015) S2: t(72)=2.233 32 | hack_6 (2015) S3: t(56)=2.277 33 | hack_6 (2015) S4: t(74)=2.146 34 | hack_6 (2015) S5: t(54)=2.084 35 | hack_7 (2015) S1: t(96)=1.988 36 | hack_7 (2015) S2: t(52)=2.237 37 | hack_7 (2015) S3: t(96)=2.013 38 | hack_7 (2015) S4: t(80)=2.121 39 | hack_7 (2015) S5: t(50)=2.201 40 | hack_8 (2015) S1: t(50)=2.276 41 | hack_8 (2015) S2: t(52)=2.255 42 | hack_8 (2015) S3: t(50)=2.29 43 | hack_8 (2015) S4: t(50)=3.594 44 | hack_8 (2015) S5: t(50)=2.722 45 | hack_9 (2015) S1: t(72)=2.163 46 | hack_9 (2015) S2: t(76)=2.175 47 | hack_9 (2015) S3: t(50)=2.756 48 | hack_9 (2015) S4: t(66)=2.095 49 | hack_9 (2015) S5: t(74)=2.045 50 | hack_10 (2015) S1: t(74)=2.032 51 | hack_10 (2015) S2: t(64)=2.082 52 | hack_10 (2015) S3: t(54)=2.15 53 | hack_10 (2015) S4: t(94)=2.059 54 | hack_10 (2015) S5: t(94)=2.037 55 | hack_11 (2015) S1: t(86)=2.027 56 | hack_11 (2015) S2: t(68)=2.031 57 | hack_11 (2015) S3: t(52)=2.189 58 | hack_11 (2015) S4: t(56)=2.045 59 | hack_11 (2015) S5: t(72)=2.009 60 | hack_12 (2015) S1: t(60)=2.465 61 | hack_12 (2015) S2: t(50)=2.182 62 | hack_12 (2015) S3: t(94)=2.142 63 | hack_12 (2015) S4: t(60)=2.113 64 | hack_12 (2015) S5: t(50)=2.988 65 | hack_13 (2015) S1: t(50)=3.2 66 | hack_13 (2015) S2: t(94)=2.062 67 | hack_13 (2015) S3: t(74)=1.985 68 | hack_13 (2015) S4: t(52)=2.105 69 | hack_13 (2015) S5: t(88)=1.985 70 | hack_14 (2015) S1: t(86)=2.15 71 | hack_14 (2015) S2: t(54)=2.276 72 | hack_14 (2015) S3: t(58)=2.222 73 | hack_14 (2015) S4: t(50)=2.959 74 | hack_14 (2015) S5: t(72)=2.002 75 | hack_15 (2015) S1: t(56)=2.038 76 | hack_15 (2015) S2: t(78)=1.983 77 | hack_15 (2015) S3: t(58)=2.267 78 | hack_15 (2015) S4: t(64)=2.007 79 | hack_15 (2015) S5: t(60)=1.996 80 | hack_16 (2015) S1: t(98)=2.478 81 | hack_16 (2015) S2: t(64)=2.167 82 | hack_16 (2015) S3: t(52)=2.021 83 | hack_16 (2015) S4: t(56)=2.323 84 | hack_16 (2015) S5: t(68)=2.268 85 | hack_17 (2015) S1: t(68)=2.014 86 | hack_17 (2015) S2: t(54)=2.243 87 | hack_17 (2015) S3: t(92)=2.143 88 | hack_17 (2015) S4: t(50)=2.875 89 | hack_17 (2015) S5: t(50)=2.124 90 | hack_18 (2015) S1: t(86)=2.088 91 | hack_18 (2015) S2: t(50)=2.08 92 | hack_18 (2015) S3: t(52)=2.076 93 | hack_18 (2015) S4: t(50)=2.056 94 | hack_18 (2015) S5: t(54)=2.215 95 | hack_19 (2015) S1: t(52)=2.368 96 | hack_19 (2015) S2: t(66)=1.983 97 | hack_19 (2015) S3: t(50)=2.054 98 | hack_19 (2015) S4: t(58)=2.145 99 | hack_19 (2015) S5: t(66)=2.041 100 | hack_20 (2015) S1: t(52)=2.28 101 | hack_20 (2015) S2: t(50)=2.066 102 | hack_20 (2015) S3: t(64)=2.124 103 | hack_20 (2015) S4: t(50)=2.17 104 | hack_20 (2015) S5: t(52)=2.083 105 | -------------------------------------------------------------------------------- /demo-data/H1_100x5.txt: -------------------------------------------------------------------------------- 1 | #' @title Simulated data from H1 (d=0.5) 2 | #' @subtitle by F. Schönbrodt 3 | #' @details Results are from H1 (d=0.5), only significant results are published. 4 | 5 | H1_d0.5_1 (2015) S1: t(48)=2.154 6 | H1_d0.5_1 (2015) S2: t(48)=2.077 7 | H1_d0.5_1 (2015) S3: t(48)=2.589 8 | H1_d0.5_1 (2015) S4: t(48)=2.203 9 | H1_d0.5_1 (2015) S5: t(48)=2.091 10 | H1_d0.5_2 (2015) S1: t(48)=2.063 11 | H1_d0.5_2 (2015) S2: t(48)=3.57 12 | H1_d0.5_2 (2015) S3: t(48)=3.242 13 | H1_d0.5_2 (2015) S4: t(48)=2.474 14 | H1_d0.5_2 (2015) S5: t(48)=2.053 15 | H1_d0.5_3 (2015) S1: t(48)=2.31 16 | H1_d0.5_3 (2015) S2: t(48)=2.445 17 | H1_d0.5_3 (2015) S3: t(48)=2.322 18 | H1_d0.5_3 (2015) S4: t(48)=3.16 19 | H1_d0.5_3 (2015) S5: t(48)=2.617 20 | H1_d0.5_4 (2015) S1: t(48)=3.515 21 | H1_d0.5_4 (2015) S2: t(48)=2.035 22 | H1_d0.5_4 (2015) S3: t(48)=3.274 23 | H1_d0.5_4 (2015) S4: t(48)=3.138 24 | H1_d0.5_4 (2015) S5: t(48)=2.177 25 | H1_d0.5_5 (2015) S1: t(48)=3.132 26 | H1_d0.5_5 (2015) S2: t(48)=2.668 27 | H1_d0.5_5 (2015) S3: t(48)=3.353 28 | H1_d0.5_5 (2015) S4: t(48)=2.097 29 | H1_d0.5_5 (2015) S5: t(48)=2.537 30 | H1_d0.5_6 (2015) S1: t(48)=2.228 31 | H1_d0.5_6 (2015) S2: t(48)=2.196 32 | H1_d0.5_6 (2015) S3: t(48)=2.619 33 | H1_d0.5_6 (2015) S4: t(48)=2.215 34 | H1_d0.5_6 (2015) S5: t(48)=2.915 35 | H1_d0.5_7 (2015) S1: t(48)=2.339 36 | H1_d0.5_7 (2015) S2: t(48)=2.067 37 | H1_d0.5_7 (2015) S3: t(48)=2.732 38 | H1_d0.5_7 (2015) S4: t(48)=2.092 39 | H1_d0.5_7 (2015) S5: t(48)=5.437 40 | H1_d0.5_8 (2015) S1: t(48)=2.143 41 | H1_d0.5_8 (2015) S2: t(48)=3.614 42 | H1_d0.5_8 (2015) S3: t(48)=3.151 43 | H1_d0.5_8 (2015) S4: t(48)=2.109 44 | H1_d0.5_8 (2015) S5: t(48)=2.227 45 | H1_d0.5_9 (2015) S1: t(48)=2.321 46 | H1_d0.5_9 (2015) S2: t(48)=2.087 47 | H1_d0.5_9 (2015) S3: t(48)=3.445 48 | H1_d0.5_9 (2015) S4: t(48)=3.183 49 | H1_d0.5_9 (2015) S5: t(48)=2.325 50 | H1_d0.5_10 (2015) S1: t(48)=2.26 51 | H1_d0.5_10 (2015) S2: t(48)=2.436 52 | H1_d0.5_10 (2015) S3: t(48)=2.156 53 | H1_d0.5_10 (2015) S4: t(48)=2.336 54 | H1_d0.5_10 (2015) S5: t(48)=4.319 55 | H1_d0.5_11 (2015) S1: t(48)=3.287 56 | H1_d0.5_11 (2015) S2: t(48)=2.084 57 | H1_d0.5_11 (2015) S3: t(48)=2.103 58 | H1_d0.5_11 (2015) S4: t(48)=2.557 59 | H1_d0.5_11 (2015) S5: t(48)=2.131 60 | H1_d0.5_12 (2015) S1: t(48)=2.97 61 | H1_d0.5_12 (2015) S2: t(48)=2.8 62 | H1_d0.5_12 (2015) S3: t(48)=2.17 63 | H1_d0.5_12 (2015) S4: t(48)=3.68 64 | H1_d0.5_12 (2015) S5: t(48)=3.135 65 | H1_d0.5_13 (2015) S1: t(48)=2.209 66 | H1_d0.5_13 (2015) S2: t(48)=2.053 67 | H1_d0.5_13 (2015) S3: t(48)=2.056 68 | H1_d0.5_13 (2015) S4: t(48)=2.384 69 | H1_d0.5_13 (2015) S5: t(48)=3.187 70 | H1_d0.5_14 (2015) S1: t(48)=2.952 71 | H1_d0.5_14 (2015) S2: t(48)=2.922 72 | H1_d0.5_14 (2015) S3: t(48)=2.122 73 | H1_d0.5_14 (2015) S4: t(48)=2.522 74 | H1_d0.5_14 (2015) S5: t(48)=2.858 75 | H1_d0.5_15 (2015) S1: t(48)=3.565 76 | H1_d0.5_15 (2015) S2: t(48)=2.174 77 | H1_d0.5_15 (2015) S3: t(48)=2.184 78 | H1_d0.5_15 (2015) S4: t(48)=2.508 79 | H1_d0.5_15 (2015) S5: t(48)=2.635 80 | H1_d0.5_16 (2015) S1: t(48)=3.066 81 | H1_d0.5_16 (2015) S2: t(48)=2.069 82 | H1_d0.5_16 (2015) S3: t(48)=2.615 83 | H1_d0.5_16 (2015) S4: t(48)=3.941 84 | H1_d0.5_16 (2015) S5: t(48)=3.345 85 | H1_d0.5_17 (2015) S1: t(48)=3.375 86 | H1_d0.5_17 (2015) S2: t(48)=2.585 87 | H1_d0.5_17 (2015) S3: t(48)=3.862 88 | H1_d0.5_17 (2015) S4: t(48)=3.386 89 | H1_d0.5_17 (2015) S5: t(48)=2.729 90 | H1_d0.5_18 (2015) S1: t(48)=2.919 91 | H1_d0.5_18 (2015) S2: t(48)=2.476 92 | H1_d0.5_18 (2015) S3: t(48)=2.245 93 | H1_d0.5_18 (2015) S4: t(48)=3.684 94 | H1_d0.5_18 (2015) S5: t(48)=3.572 95 | H1_d0.5_19 (2015) S1: t(48)=3.493 96 | H1_d0.5_19 (2015) S2: t(48)=2.917 97 | H1_d0.5_19 (2015) S3: t(48)=2.614 98 | H1_d0.5_19 (2015) S4: t(48)=3.435 99 | H1_d0.5_19 (2015) S5: t(48)=2.269 100 | H1_d0.5_20 (2015) S1: t(48)=2.41 101 | H1_d0.5_20 (2015) S2: t(48)=3.568 102 | H1_d0.5_20 (2015) S3: t(48)=2.62 103 | H1_d0.5_20 (2015) S4: t(48)=2.061 104 | H1_d0.5_20 (2015) S5: t(48)=2.433 105 | -------------------------------------------------------------------------------- /demo-data/IQ_grades.txt: -------------------------------------------------------------------------------- 1 | Adkins (1937): r(74) = 0.56 2 | Agnoli, Mancini, Pozzoli, Baldaro, Russo, & Surcinelli (2012): r(349) = 0.38 3 | Al-Ghamri (2012): r(679) = 0.81 4 | Al-Ghamri (2012): r(463) = 0.81 5 | Al-Ghamri (2012): r(410) = 0.80 6 | Allana (2010): r(12) = 0.98 7 | Allana (2010): r(12) = 0.88 8 | Ames (1943): r(253) = 0.59 9 | Ames (1943): r(274) = 0.59 10 | Ames (1943): r(278) = 0.54 11 | Anonymoush: r(90) = 0.23 12 | Anonymoush: r(55) = 0.24 13 | Anonymoush: r(1505) = 0.25 14 | Anonymoush: r(526) = 0.33 15 | Anonymoush: r(715) = 0.35 16 | Anonymoush: r(697) = 0.36 17 | Anonymoush: r(707) = 0.33 18 | Anonymoush: r(712) = 0.25 19 | Anonymoush: r(1386) = 0.29 20 | Anonymoush: r(82) = 0.44 21 | Anonymoush: r(274) = 0.46 22 | Anonymoush: r(309) = 0.07 23 | Aswal (2001): r(62) = 0.58 24 | Aswal (2001): r(22) = 0.61 25 | Aswal (2001): r(47) = 0.39 26 | Aswal (2001): r(32) = 0.46 27 | Aswal (2001): r(22) = 0.35 28 | Axelsson (2009): r(121) = 0.50 29 | Barton, Dielman, & Cattell (1971): r(166) = 0.43 30 | Barton, Dielman, & Cattell (1971): r(139) = 0.49 31 | Beckett, Castle, Rutter, & Sonuga-Barke (2010): r(158) = 0.64 32 | Bipp, Steinmayr, & Spinath (2012): r(161) = 0.35 33 | Blöschl (1966): r(122) = -0.03 34 | Blue (2009): r(449) = 0.32 35 | Bose (1982): r(247) = 0.18 36 | Bouffard, Vezeau, Roy, & Lengelé (2011): r(459) = 0.77 37 | Boulon-Díaz (1992): r(62) = 0.66 38 | Bowers (1966): r(275) = 0.57 39 | Bratko, Chamorro-Premuzic, & Saks (2006): r(252) = 0.49 40 | Brucks (1978): r(182) = 0.61 41 | Burgert (1937): r(188) = 0.48 42 | Carter (1959): r(113) = 0.66 43 | Carter (1959): r(236) = 0.53 44 | Carter (1959): r(208) = 0.50 45 | Chamorro-Premuzic, Quiroga, & Colom (2009): r(245) = 0.01 46 | Cocking & Holy (1927): r(263) = 0.42 47 | Cooper (1974): r(524) = 0.20 48 | Craig (1988): r(102) = 0.50 49 | Daley, Whaley, Sigman, Guthrie, Neumann, & Bwibo (2005): r(240) = 0.34 50 | Daley, Whaley, Sigman, Guthrie, Neumann, & Bwibo (2005): r(231) = 0.40 51 | Dash, Mohanty, & Kar (1989): r(57) = 0.31 52 | Day, Hanson, Maltby, Proctor, & Wood (2010): r(126) = 0.43 53 | Di Fabio & Palazzeschi (2009): r(121) = 0.32 54 | Dodonova & Dodonov (2012): r(181) = 0.19 55 | Downey, Lomas, Billings, Hansen, & Stough (2013): r(240) = 0.46 56 | Dresel, Fasching, Steuer, & Berner (2010): r(793) = 0.23 57 | Duckworth, Quinn, & Tsukayama (2012): r(703) = 0.48 58 | Duckworth, Quinn, & Tsukayama (2012): r(507) = 0.41 59 | Edds & McCall (1933): r(82) = 0.32 60 | Edminston & Rhoades (1959): r(91) = 0.56 61 | Falch& Sandgren Massih (2011): r(634) = 0.62 62 | Fischbach, Baudson, Preckel, Martin, & Brunner (2013): r(1598) = 0.51 63 | Fischer, Schult, & Hell (2013): r(229) = 0.37 64 | Fischer, Schult, & Hell (2013): r(217) = 0.43 65 | Flere, Krajnc, Klanjšek, Musil, & Kirbiš (2010): r(1305) = 0.48 66 | Frandsen (1950): r(80) = 0.60 67 | Freudenthaler, Spinath, & Neubauer (2008): r(776) = 0.55 68 | Freudenthaler, Spinath, & Neubauer (2008): r(523) = 0.53 69 | Freund & Holling (2011): r(643) = 0.36 70 | Freund, Holling, & Preckel (2007): r(1132) = 0.48 71 | Friedhoff (1955): r(45) = 0.61 72 | Friedhoff (1955): r(56) = 0.49 73 | Friedhoff (1955): r(100) = 0.50 74 | Friedhoff (1955): r(96) = 0.51 75 | Furnham & Monsen (2009): r(262) = 0.35 76 | Furnham, Monsen, & Ahmetoglu (2009): r(209) = 0.49 77 | Gagné & St. Père (2002): r(153) = 0.46 78 | Ghosh (1960): r(117) = 0.29 79 | Ghosh (1960): r(117) = 0.39 80 | Gilles & Bailleux (2001): r(119) = 0.27 81 | Gralewski & Karwowski (2012): r(586) = 0.15 82 | Hartlage & Steele (1977): r(33) = 0.59 83 | Hartson (1939): r(2118) = 0.00 84 | Haugwitz, Nesbit, & Sandmann (2010): r(245) = 0.17 85 | Heaven & Ciarrochi (2012): r(783) = 0.46 86 | Hinkelman (1955): r(26) = 0.57 87 | Hintsanen, Alatupa, Jokela, Lipsanen, Hintsa, & Leino (2012): r(306) = 0.62 88 | Hofer, Kuhnle, Kilian, & Fries (2012): r(694) = 0.34 89 | Irwin, Engle, Yarbrough, Klein, & Townsend (1978): r(122) = 0.34 90 | Irwin, Engle, Yarbrough, Klein, & Townsend (1978): r(127) = 0.42 91 | Johnson & McGowan (1984): r(48) = 0.17 92 | Johnson (1967): r(123) = 0.63 93 | Johnson, Deary, & Iacono (2009): r(1645) = 0.40 94 | Jordan (1922): r(64) = 0.47 95 | Kanderian (1970): r(301) = 0.30 96 | Karbach, Gottschling, Spengler, Hegewald, & Spinath (2013): r(331) = 0.38 97 | Kaufman, DeYoung, Gray, Jiménez, Brown, & Mackintosh (2010): r(106) = 0.23 98 | Keehn & Prothro (1955): r(51) = 0.35 99 | Keehn & Prothro (1955): r(45) = 0.19 100 | Keehn & Prothro (1955): r(45) = 0.16 101 | Keehn & Prothro (1955): r(53) = 0.35 102 | Kessels & Steinmayr (2013): r(177) = 0.30 103 | Kleitman & Moscrop (2010): r(181) = 0.35 104 | Krumm, Lipnevich, Schmidt-Atzert, & Bühner (2012): r(158) = 0.27 105 | Kundu (1962): r(55) = 0.31 106 | Kundu (1975): r(47) = 0.68 107 | Kundu (1975): r(47) = 0.63 108 | Kundu (1975): r(47) = 0.31 109 | Kundu (1975): r(47) = 0.57 110 | Kuusinen & Leskinen (1988): r(231) = 0.30 111 | Kwall & Lackner (1966): r(97) = 0.77 112 | Lemos, Abad, Almeida, & Colom (2014): r(1098) = 0.32 113 | Lemos, Abad, Almeida, & Colom (2014): r(1692) = 0.37 114 | Levpušček, Zupančič, & Sočan (2013): r(397) = 0.51 115 | Lindgren & De Almeida Guedes (1963): r(85) = 0.61 116 | Lindgren & De Almeida Guedes (1963): r(52) = 0.61 117 | Line & Glen (1935): r(58) = 0.57 118 | Line & Glen (1935): r(126) = 0.46 119 | Line & Glen (1935): r(116) = 0.39 120 | Line & Glen (1935): r(88) = 0.15 121 | Line & Glen (1935): r(121) = 0.47 122 | Lu, Weber, Spinath & Shi (2011): r(176) = 0.45 123 | Lubbers, Van Der Werf, Kuyper, & Hendriks (2010): r(9773) = 0.25 124 | Marcus (2000): r(207) = 0.36 125 | Marcus, Wagner, Poole, Powell, & Carswell (2009): r(47) = 0.39 126 | Marcus, Wagner, Poole, Powell, & Carswell (2009): r(112) = 0.45 127 | Marcus, Wagner, Poole, Powell, & Carswell (2009): r(96) = 0.21 128 | Matlin & Mendelsohn (1965): r(65) = 0.60 129 | Matthews, Marulis, & Williford (2014): r(920) = 0.42 130 | Mayer (1958): r(97) = 0.73 131 | Meili, Aebi, Heizmann, & Schoefer (1977): r(182) = 0.34 132 | Meili, Aebi, Heizmann, & Schoefer (1977): r(150) = 0.32 133 | Meili, Aebi, Heizmann, & Schoefer (1977): r(125) = 0.38 134 | Meili, Aebi, Heizmann, & Schoefer (1977): r(101) = 0.39 135 | Meili, Aebi, Heizmann, & Schoefer (1977): r(84) = 0.51 136 | Meili, Aebi, Heizmann, & Schoefer (1977): r(172) = 0.39 137 | Meili, Aebi, Heizmann, & Schoefer (1977): r(206) = 0.44 138 | Meili, Aebi, Heizmann, & Schoefer (1977): r(136) = 0.45 139 | Meili, Aebi, Heizmann, & Schoefer (1977): r(278) = 0.38 140 | Millikin (1976): r(303) = 0.68 141 | Moenikia & Zahed-Babelan (2010): r(1667) = 0.45 142 | Moore (1939): r(171) = 0.69 143 | Mõttus, Guljajev, Allik, Laidra, & Pullmann (2012): r(1156) = 0.43 144 | Myburgh, Grobler, & Niehaus (1999): r(653) = 0.56 145 | Neuenschwander (2013): r(184) = 0.63 146 | Neuenschwander, Röthlisberger, Cimeli, & Roebers (2012): r(456) = 0.35 147 | Oates (1929): r(32) = 0.34 148 | Oates (1929): r(32) = 0.32 149 | Oates (1929): r(31) = 0.63 150 | Oates (1929): r(30) = 0.21 151 | Oates (1929): r(31) = 0.34 152 | Oates (1929): r(30) = 0.15 153 | Oates (1929): r(13) = -0.13 154 | Oates (1929): r(25) = 0.26 155 | Oates (1929): r(26) = 0.62 156 | Peterson, Pihl, Higgins, Séguin, & Tremblay (2003): r(145) = 0.46 157 | Petrides, Chamorro-Premuzic, Frederickson, & Furnham (2005): r(294) = 0.85 158 | Petrides, Chamorro-Premuzic, Frederickson, & Furnham (2005): r(318) = 0.84 159 | Phillipson & Phillipson (2012): r(777) = 0.28 160 | Powell & Nettelbeck (2014): r(157) = 0.49 161 | Preckel & Brüll (2010): r(675) = 0.43 162 | Preckel, Götz, & Frenzel (2010): r(141) = 0.62 163 | Preckel, Lipnevich, Boehme, Brandner, Georgi, Könen, Mursin & Roberts (2013): r(234) = 0.44 164 | Qualter, Gardner, Pope, Hutchinson, & Whiteley (2012): r(211) = 0.43 165 | Qualter, Gardner, Pope, Hutchinson, & Whiteley (2012): r(196) = 0.64 166 | Rauh (1977): r(39) = 0.72 167 | Rindermann & Neubauer (2000): r(154) = 0.44 168 | Rindermann & Neubauer (2004): r(268) = 0.52 169 | Rogers (1933): r(77) = 0.62 170 | Rosander & Bäckström (2012): r(242) = 0.49 171 | Rosander & Bäckström (2012): r(194) = 0.49 172 | Rosander, Bäckström, & Stenberg (2011): r(294) = 0.38 173 | Sauer & Gamsjäger (1996): r(648) = 0.56 174 | Sauer & Gattringer (1986): r(596) = 0.66 175 | Scarr, Caparlo, Ferndman, Tower, & Caplan (1983): r(636) = 0.73 176 | Schaefer & McDermott (1999): r(417) = 0.40 177 | Schneider, Grabner, & Paetsch (2009): r(192) = 0.60 178 | Schult (2013): r(38) = 0.36 179 | Schult (2013): r(432) = 0.33 180 | Schult (2013): r(1030) = 0.51 181 | Schult (2013): r(43) = 0.63 182 | Schult (2013): r(290) = 0.35 183 | Schult (2013): r(765) = 0.43 184 | Schwinger, Steinmayr, & Spinath (2009): r(228) = 0.23 185 | Seitz (1971): r(96) = 0.18 186 | Sharma, Sharma, & Sharma (2011): r(97) = 0.45 187 | Sharma, Sharma, & Sharma (2011): r(97) = 0.52 188 | Singh & Varma (1995): r(197) = 0.02 189 | Singh & Varma (1995): r(197) = 0.02 190 | Sonnleitner, Keller, Martin, & Brunner (2013): r(560) = 0.51 191 | Spinath, Freudenthaler, & Neubauer (2010): r(798) = 0.41 192 | Spinath, Freudenthaler, & Neubauer (2010): r(519) = 0.47 193 | Spinath, Spinath, & Plomin (2008): r(4489) = 0.43 194 | St. John (1930): r(452) = 0.55 195 | St. John (1930): r(500) = 0.44 196 | Steinmayr, R., Dinger, & Spinath (2010): r(545) = 0.27 197 | Steinmayr & Meißner (2013): r(184) = 0.26 198 | Steinmayr & Meißner (2013): r(273) = 0.39 199 | Steinmayr & Spinath (2009): r(325) = 0.35 200 | Steinmayr, Wirthwein, & Schöne (2014): r(298) = 0.41 201 | Stejskal (1935): r(3211) = 0.66 202 | Süß (2001): r(134) = 0.16 203 | Svensson (1971): r(1497) = 0.66 204 | Svensson (1971): r(6141) = 0.69 205 | Svensson (1971): r(8902) = 0.67 206 | Te Nijenhuis, Resing, Tolboom, & Bleichrodt (2004): r(193) = 0.54 207 | Te Nijenhuis, Resing, Tolboom, & Bleichrodt (2004): r(201) = 0.43 208 | Te Nijenhuis, Resing, Tolboom, & Bleichrodt (2004): r(189) = 0.50 209 | Te Nijenhuis, Resing, Tolboom, & Bleichrodt (2004): r(181) = 0.40 210 | Telles Da Silva, Borges Osorio, & Salzano (1975): r(76) = 0.27 211 | Telles Da Silva, Borges Osorio, & Salzano (1975): r(72) = 0.25 212 | Tiedemann & Faber (1992): r(93) = 0.19 213 | Todt (1966): r(92) = 0.33 214 | Todt (1966): r(110) = 0.43 215 | Trautwein, Lüdtke, Roberts, Schnyder, & Niggli (2009): r(568) = 0.16 216 | Trautwein, Lüdtke, Roberts, Schnyder, & Niggli (2009): r(412) = 0.29 217 | Trautwein, Lüdtke, Roberts, Schnyder, & Niggli (2009): r(1532) = 0.22 218 | Trost & Bickel (1979): r(110) = 0.31 219 | Trost & Bickel (1979): r(523) = 0.26 220 | Turney (1930): r(65) = 0.65 221 | Turney (1930): r(67) = 0.56 222 | Turney (1930): r(62) = 0.61 223 | Turney (1930): r(62) = 0.69 224 | Valenzuela (1971): r(17) = 0.19 225 | Valenzuela (1971): r(17) = 0.48 226 | Vecchione, Alessandri, & Marsicano (2014): r(51) = 0.09 227 | Vecchione, Alessandri, & Marsicano (2014): r(44) = 0.26 228 | Vock, Preckel, & Holling (2011): r(1132) = 0.40 229 | Vrdoljak & Velki (2012): r(158) = 0.45 230 | Watkins & Astilla (1980): r(184) = 0.63 231 | Watterson, Schuerger, & Melnyk (1976): r(160) = 0.31 232 | Weber, Lu, Shi, & Spinath (2013): r(317) = 0.32 233 | Wellman (1957): r(117) = 0.74 234 | Wright & Parker (1978): r(32) = 0.27 235 | Wright & Parker (1978): r(55) = 0.52 236 | Xin & Zhang (2009): r(116) = 0.45 237 | Zaunbauer, Retelsdorf, & Möller (2009): r(289) = 0.14 238 | Zaunbauer, Retelsdorf, & Möller (2009): r(415) = 0.12 239 | Ziegler, Knogler, & Bühner (2009): r(268) = 0.22 240 | Zuffianò, Alessandri, Gerbino, Luengo Kanacri, Di Giunta, Milioni, & Caprara (2013): r(167) = 0.30 -------------------------------------------------------------------------------- /demo-data/JPSP-p-curve.txt: -------------------------------------------------------------------------------- 1 | #' @title Analysis of (presumably) non-hacked JPSP test statistics 2 | #' @subtitle by Simonsohn, Nelson, & Simmons 3 | #' @details See also Simonsohn, U., Nelson, L. D., & Simmons, J. P. (2014). P-curve: A key to the file-drawer. Journal of Experimental Psychology: General, 143, 534–547, Figure 3B. 4 | #' @url http://www.p-curve.com/Supplement/full_pdt.xlsx 5 | 6 | # To replicate the results of the paper, deselect "Gracious rounding up" and deselect "Make p-curve robust to outliers". 7 | 8 | F(1,57)=7.25; p=0.0093 9 | t(39)=4.16; p=0.0002 10 | t(38)=2.67; p=0.0111 11 | F(1,77)=5.86; p=0.0178 12 | F(1,48)=4.12; p=0.0479 13 | F(1,27)=4.21; p=0.0500002 14 | t(30)=2.52; p=0.0173 15 | t(30)=2.5; p=0.0181 16 | F(1,31)=6.73; p=0.0143 17 | F(1,92)=4.45; p=0.0376 18 | F(1,32)=4.46; p=0.0426 19 | F(1,52)=5.08; p=0.0284 20 | t(20)=3.36; p=0.0031 21 | t(19)=3.79; p=0.0012 22 | F(1,72)=22.56; p=0.00001 23 | t(26)=4.98; p=0.00003543 24 | t(46)=2.07; p=0.0441 25 | F(1,63)=8.27; p=0.0055 26 | F(1,45)=7.62; p=0.0083 27 | t(9)=2.03; p=0.0729 28 | t(9)=1.69; p=0.1253 29 | F(1,55)=9.96; p=0.0026 30 | F(1,104)=5.04; p=0.0269 31 | F(1,44)=8.38; p=0.0059 32 | t(36)=2.35; p=0.0244 33 | -------------------------------------------------------------------------------- /demo-data/Shanks.txt: -------------------------------------------------------------------------------- 1 | r(24) = .55; BS 2 | r(21) = .45; BS 3 | t(72) = 4.80; BS 4 | F(1, 40) = 5.00; BS 5 | F(1, 48) = 7.46; BS 6 | t(131) = 2.51; BS 7 | t(131) = 2.25; BS 8 | t(29) = 2.17; BS 9 | t(40) = 2.61; BS 10 | t(110) = 6.09; BS 11 | t(94) = 5.12; BS 12 | F(1, 87) = 3.82; BS 13 | F(1, 68) = 7.10; BS 14 | F(1, 71) = 4.83; BS 15 | F(1, 93) = 6.37; BS 16 | F(1, 94) = 4.57; BS 17 | F(1, 101) = 4.84; BS 18 | F(1, 101) = 4.31; BS 19 | F(1, 195) = 10.64; BS 20 | F(1, 58) = 7.88; BS 21 | F(1, 164) = 3.66; BS 22 | F(1, 106) = 6.26; BS 23 | F(1, 148) = 12.22; BS 24 | F(1, 144) = 4.27; BS 25 | F(1, 57) = 4.58; BS 26 | F(1, 74) = 5.58; BS 27 | F(1, 114) = 7.29; BS 28 | F(1, 52) = 4.74; BS 29 | F(1, 177) = 9.62; BS 30 | F(1, 98) = 4.75; BS 31 | F(1, 102) = 9.11; BS 32 | F(1, 210) = 4.43; BS 33 | F(1, 166) = 6.59; BS 34 | F(1, 105) = 8.54; BS 35 | F(1, 136) = 4.03; BS 36 | F(1,40) = 4.75; BS 37 | F(1,33) = 8.88; BS 38 | F(1, 87) = 9.99; BS 39 | F(1, 38) = 8.54; BS 40 | F(1, 64) = 8.61; BS 41 | t(112) = 1.96; BS 42 | t(119) = 3.42; BS 43 | t(44) = 1.85; BS -------------------------------------------------------------------------------- /demo-data/elderly_priming.txt: -------------------------------------------------------------------------------- 1 | #' @title ELDERLY PRIMING 2 | #' @subtitle by D. Lakens 3 | #' @details p-curve analysis from Lakens, D. (2014). Professors are not elderly: Evaluating the evidential value of two social priming effects through p-curve analyses. Available at SSRN: http://ssrn.com/abstract=2381936 or http://dx.doi.org/10.2139/ssrn.2381936 4 | #' @url https://osf.io/3urp2/ 5 | 6 | # Test statistics kindly provided by Daniel Lakens at https://osf.io/3urp2/ 7 | 8 | A&D (2002) S1: F(1, 102) = 4.95; p < .03 9 | A&D (2002) S1: F(1, 102) = 4.29; p < .05 10 | A&D (2002) S2: F(1, 160) = 4.68; p < .05 11 | A&D (2002) S2: F(1, 160) = 6.07, p < .02 12 | 13 | BC&B (1996) S2a: t(28) = 2.86; p < .01 14 | BC&B (1996) S2b: t(28) = 2.16; p < .05 15 | 16 | CP&H (2006) S1: t(47) = 2.04; p = .05 17 | CP&H (2006) S2: F(1, 64) = 5.81; p = .02 18 | 19 | DAB&vK (2000) S1: F(1, 71) = 4.06; p < .05 20 | DAB&vK (2000) S2: F(1, 36) = 4.26; p < .05 21 | 22 | DS&L (2001) S1: F(1, 151) = 4.18; p =.05 23 | DS&L (2001) S2: F(1, 77) = 12.71; p < .001 24 | DS&L (2001) S3: F(1, 61) = 4.23; p < .05 25 | 26 | KY&D (2002) S1: t(58) = 2.46; p < .05 27 | KY&D (2002) S2: t(64) = 2.18; p < .05 28 | 29 | KW&G (2010) S2: t(29) = 2.08; p = .047 30 | KW&G (2010) S2: t(27) = 2.23; p = .04 31 | 32 | M (2006) S2: t(35) = 2.1; p < .05 33 | -------------------------------------------------------------------------------- /demo-data/glucose.txt: -------------------------------------------------------------------------------- 1 | #' @title Glucose Model of Ego Depletion 2 | #' @subtitle by M. Vadillo et al. 3 | #' @details Data from Vadillo, M. A., Gold, N., & Osman, M. (2016). The Bitter Truth About Sugar and Willpower: The Limited Evidential Value of the Glucose Model of Ego Depletion. Psychological Science (online first). http://doi.org/10.1177/0956797616654911 4 | #' @url https://osf.io/438jx/ 5 | 6 | # For disclosure table about in/exclusion of effect sizes, see the link. 7 | # Thanks to @mavadillo for sharing open data! 8 | 9 | t(15) = 2.469 10 | t(67) = 2.19 11 | t(151) = 2.24 12 | F(1,55) = 6.64 13 | z = 1.88; one-tailed 14 | F(1,177) = 5.63 15 | r(50) = .30 16 | F(1,100) = 6.08 17 | t(33) = 2.20 18 | r(14) = .62 19 | r(10) = .56; one-tailed 20 | r(21) = .45 21 | r(15) = .43; one-tailed 22 | F(1,57) = 5.04 23 | F(1,69) = 5.45 24 | t(16) = 3.13 25 | t(47) = 2.21 26 | F(1,24) = 8.42 27 | F(1,30) = 6.12 28 | F(1,32) = 4.06; crit=.06 # "significantly better" 29 | F(1,40) = 10.32 30 | F(1,36) = 7.28 31 | F(4,75) = 2.95 32 | t(78) = 2.10 33 | F(1,58) = 5.16 34 | F(1,139) = 5.28 35 | F(1,67) = 0.80 36 | F(1,68) = 1.12 37 | F(1,110) = 0.01 38 | t(68) = 0.05 39 | F(1,111) = 5.311 40 | F(1,83) = 2.05 41 | F(1,39) = 4.54 42 | F(1,28) = 5.02 43 | F(1,158) = 0.379 44 | t(49) = 2.129 45 | t(31) = 2.55 46 | t(32) = 3.12 -------------------------------------------------------------------------------- /demo-data/moneypriming.txt: -------------------------------------------------------------------------------- 1 | #' @title Glucose Model of Ego Depletion 2 | #' @subtitle by M. Vadillo et al. 3 | #' @details Vadillo, M. A., Hardwicke, T. E., & Shanks, D. R. (2016). Selection bias, vote counting, and money-priming effects: A comment on Rohrer, Pashler, and Harris (2015) and Vohs (2015). Journal of Experimental Psychology: General, 145(5), 655–663. http://doi.org/10.1037/xge0000157. Note: The results slightly differ from the paper, as these analyses are based on the p-curve disclosure table, which contains a slightly different ES selection than the meta-analyses reported in the paper. 4 | #' @url https://osf.io/4e3gy 5 | 6 | # For disclosure table about in/exclusion of effect sizes, see the link. 7 | # Thanks to @mavadillo for sharing open data! 8 | 9 | # Vohs et al. + Caruso et al. 10 | t(28) = 2.12 11 | t(166) = 2.81 12 | t(78) = 2.24 13 | F(1, 271) = 14.63 14 | F(1, 88) = 6.93 15 | F(2,49) = 3.73 16 | t(35) = 2.03 17 | t(37) = 2.06 18 | t(42) = 2.13 19 | F(2, 32) = 4.34 20 | t(38) = 2.13 21 | t(33) = 2.37 22 | F(2, 58) = 4.04 23 | Chi2(2) = 10.10 24 | 25 | # robustness 26 | F(1, 271) = 10.22 27 | t(33) = 2.30 28 | 29 | 30 | # Table 1 in Vohs et al. 31 | 32 | F (1,76) = 4.81 33 | F(1,49)=4.18 34 | F(1, 37)=6.63 35 | t(66) = 3.15 36 | t(88) = 2.99 37 | F(2, 308) = 4.08 38 | F(2, 84) = 10.02 39 | F(1, 86) = 4.86 40 | F(1, 80)=4.39 41 | F(1, 92)=5.49 42 | 43 | 44 | # replication studies: Rohrer et al. + ManyLabs 1 45 | 46 | t(82) = -0.03 47 | t(118) = 0.96 48 | t(82) = -0.67 49 | t(93) = 1.12 50 | t(94) = 0.06 51 | t(100) = -1.19 52 | t(88) = 0.04 53 | t(172) = 0.77 54 | t(111) = 0.67 55 | t(110) = -0.74 56 | t(275) = -1.35 57 | t(143) = -0.41 58 | t(92) = 2 59 | t(83) = 0.9 60 | t(997) = -1.02 61 | t(105) = 0.49 62 | t(120) = 0.2 63 | t(1324) = -0.51 64 | t(93) = 0.07 65 | t(100) = 0.15 66 | t(83) = 0.61 67 | t(160) = -1.37 68 | t(77) = 0.92 69 | t(167) = -0.77 70 | t(185) = -1.09 71 | t(85) = -1.22 72 | t(223) = 1.33 73 | t(78) = 0.94 74 | t(125) = -0.84 75 | t(140) = -0.17 76 | t(79) = 1.33 77 | t(105) = -0.29 78 | t(94) = -1 79 | t(101) = 0.87 80 | t(88) = 1.14 81 | t(85) = -0.88 82 | t(134) = -0.43 83 | t(418) = 0.58 84 | t(210) = 0.0 85 | t(189) = 1.70 86 | t(154) = -0.36 87 | t(114) = 0.76 88 | -------------------------------------------------------------------------------- /demo-data/powerposing.txt: -------------------------------------------------------------------------------- 1 | #' @title POWER POSING p-curve 2 | #' @subtitle by J. P. Simmons & U. Simonsohn 3 | #' @details Data from Simmons, J. P. & Simonsohn, U. (2016). Power Posing: P-Curving the Evidence. Psychological Science, Forthcoming. Available at SSRN: http://ssrn.com/abstract=2791272 (see "Main p-curve results"). 4 | #' @url http://datacolada.org/37 5 | 6 | # For disclosure table about in/exclusion of effect sizes, see blog post. 7 | # Thanks to @jpsimmon and @uri_sohn for sharing open data! 8 | 9 | Allen, Gervais, & Smith (2013): t(83)=2.24; one-tailed 10 | Allen, Gervais, & Smith (2013): t(83)=1.78; one-tailed 11 | Arnette & Pettijohn (2012): t(40)=3.28 12 | Bohns & Wiltermuth (2012), S1: t(83)=1.99 13 | Bohns & Wiltermuth (2012), S2: t(26)=2.23 14 | Brinol, Petty, & Wegener (2009): F(1,67)=9.91 15 | Carney, Cuddy, & Yap (2010), S1: chi2(1)=4.84 16 | Carney, Cuddy, & Yap (2010), S2: F(1,39)=4.29 17 | Cesario & McDonald (2013), S1: z=1.98 18 | Cesario & McDonald (2013), S2: z=1.91; crit=.06 # "Results indicated a clear, singular effect" 19 | Cuddy et al. (in press): F(1,60)=8.33 20 | Fischer et al. (2011), S2: t(34)=2.30 21 | Huang et al. (2011), S1: F(1,73)=7.08 22 | Huang et al. (2011), S2: chi2(1)=5.28 23 | Huang et al. (2011), S3: F(1,53)=5.41 24 | Lee & Schnall (2014), S2: F(1,39)=5.08 25 | Michalak et al. (2014): F(1,28)=3.78; one-tailed 26 | Nair et al. (2014): F(1,70)=6.09 27 | Park et al. (2013), S3: F(1,101)=4.02 28 | Park et al. (2013), S4: F(1,79)=4.24 29 | Riskind (1984), S2: F(1,37)=5.13 30 | Riskind (1984), S2: F(1,37)=3.20 31 | Riskind (1984), S3: F(1,18)=4.94 32 | Riskind & Gotay (1982), S1: F(1,16)=7.73 33 | Riskind & Gotay (1982), S2: t(18)=2.03; one-tailed 34 | Strelan, Weick, & Vasiljevic (2014), S3: t(79)=2.21 35 | Welker et al. (2013), S1: F(1,87)=1.26 36 | Welker et al. (2013), S2: F(1,80)=9.44 37 | Yap et al. (2013), S1: chi2(1)=13.0 38 | Yap et al. (2013), S2: F(1,29)=4.04; crit=.06 # "as predicted --> p = .05" 39 | Yap et al. (2013), S3: F(1,66)=4.12 40 | -------------------------------------------------------------------------------- /helpers.R: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # Helper functions 3 | 4 | COLORS <- list( 5 | BLUE = "#3399f3", 6 | GREEN = "#0BBC2B" 7 | ) 8 | # Helper: Transform correlation to Fisher's Z 9 | r2Z <- function(r) {return(0.5 * log((1 + r)/(1 - r)))} 10 | 11 | # Helper: Recode Fisher's z to correlation 12 | Z2r <- function(Z) {return((exp(2*Z)-1)/(exp(2*Z)+1))} 13 | 14 | 15 | # simple wrapper: formats a number in f.2 format 16 | f2 <- function(x, digits=2, prepoint=0, skipZero=FALSE) { 17 | 18 | if (skipZero == TRUE) {zero <- "."} else {zero <- "0."} 19 | 20 | if (length(dim(x)) == 2) { 21 | apply(x, 2, function(x2) {gsub("0.", zero, sprintf(paste("%",prepoint,".",digits,"f",sep=""), x2) , fixed=TRUE)}) 22 | } else { 23 | gsub("0.", zero, sprintf(paste("%",prepoint,".",digits,"f",sep=""), x) , fixed=TRUE) 24 | } 25 | } 26 | 27 | 28 | # Given a column: if numeric, convert to formatted string; otherwise, return unchanged 29 | format_num <- function(col, digits) {if (is.numeric(col)) {sprintf(paste0('%1.', digits, 'f'), col)} else {col}} 30 | format_num2 <- function(col) {if (is.numeric(col)) {sprintf(paste0('%1.0f'), col)} else {col}} 31 | 32 | 33 | # nicely formats a p-value 34 | p0 <- function(x, digits=3) { 35 | if (is.na(x)) return("NA") 36 | if (x >= .1^digits) return(paste0("p = ", f2(x, digits, skipZero=TRUE))) 37 | if (x < .1^digits) return(paste0("p < ", f2(.1^digits, digits, skipZero=TRUE))) 38 | } 39 | p <- Vectorize(p0) 40 | 41 | 42 | 43 | # Get the number of decimal places 44 | # Taken from http://stackoverflow.com/questions/5173692/how-to-return-number-of-decimal-places-in-r 45 | decimalplaces <- function(x) { 46 | if (is.na(x)) return(0) 47 | if ((x %% 1) != 0) {nchar(strsplit(sub('0+$', '', as.character(x)), ".", fixed=TRUE)[[1]][[2]])} 48 | else {return(0)} 49 | } 50 | 51 | decplaces <- function(x) {nchar(str_extract(x, "\\.\\d*$"))-1} 52 | 53 | clamp <- function(x, MIN=.00001, MAX=.99999) {x[xMAX] <- MAX; x} 54 | 55 | str_match_empty <- function(..., position=2) { 56 | res <- str_match(...)[position] 57 | if (is.na(res)) res <- "" 58 | res 59 | } 60 | 61 | logScaleHack <- function(v){ 62 | isNotPowOf10 <- (log(v, 10) %% 1) != 0 63 | v[isNotPowOf10] <- v[isNotPowOf10] + 0.1 64 | v 65 | } 66 | 67 | logScaleTicks <- function(v){ 68 | rv <- range(v) 69 | rv <- c(max(1,rv[1]), max(1,rv[2])) 70 | exponent <- floor(log(rv, 10)) 71 | mult <- round(rv / (10^(exponent))) 72 | diff <- exponent[2] - exponent[1] 73 | if( diff == 0 ){ 74 | res <- (mult[1]:mult[2])*10^exponent[1] 75 | } else if( diff == 1){ 76 | res <- c((mult[1]:9)*10^exponent[1], (1:mult[2])*10^exponent[2]) 77 | } else { 78 | res <- c( 79 | (mult[1]:9)*10^exponent[1], 80 | rep(1:9, diff-1) * 10^(rep((exponent[1]+1):(exponent[2]-1), each=9)), 81 | (1:mult[2])*10^exponent[2] 82 | ) 83 | } 84 | logScaleHack(res) 85 | } 86 | 87 | logScaleLimits <- function(v) 88 | { 89 | rv <- range(v) * c(0.9, 1.1) 90 | rv <- c(max(1,rv[1]), max(1,rv[2])) 91 | 92 | exponents <- floor(log(rv, 10)) 93 | results <- rv / (10^exponents) 94 | results <- c(floor(results[1]), ceiling(results[2])) 95 | 96 | diff <- abs(exponents[2] - exponents[1]) 97 | if(diff == 0){ 98 | results <- c(1,10) 99 | } else if(diff == 1){ 100 | if(results[1] == 1){ 101 | results[2] <- 10 102 | } else { 103 | if(results[1] > 10 - results[2]){ 104 | results[2] <- 10 105 | } else { 106 | results[1] <- 1 107 | } 108 | } 109 | } 110 | 111 | results * (10^exponents) 112 | } 113 | 114 | 115 | 116 | # --------------------------------------------------------------------- 117 | # Meta-Regression helper functions 118 | 119 | tidyRMA <- function(RMA) { 120 | res <- data.frame( 121 | term = if(length(RMA$b)==1) {"b0"} else {c("b0", "b1")}, 122 | estimate = as.vector(RMA$b), 123 | std.error = RMA$se, 124 | statistic = RMA$zval, 125 | p.value = RMA$pval, 126 | conf.low = RMA$ci.lb, 127 | conf.high = RMA$ci.ub 128 | ) 129 | rownames(res) <- NULL 130 | return(res) 131 | } 132 | 133 | tidyLM <- function(...) { 134 | res <- tidy(..., conf.int=TRUE) 135 | res$term[res$term == "(Intercept)"] <- "b0" 136 | res$term[res$term == "d.se"] <- "b1" 137 | res$term[res$term == "d.var"] <- "b1" 138 | return(res) 139 | } 140 | 141 | # this function combines tidyRMA and tidyLM 142 | tidyMR <- function(x) { 143 | if (class(x)[1] == "lm") { 144 | return(tidyLM(x)) 145 | } else { 146 | return(tidyRMA(x)) 147 | } 148 | } -------------------------------------------------------------------------------- /original code from others/Colada-37-p-curve-disclosure-table-for-Power-Posing.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/original code from others/Colada-37-p-curve-disclosure-table-for-Power-Posing.xlsx -------------------------------------------------------------------------------- /original code from others/Gervais_PowerCode_final.R: -------------------------------------------------------------------------------- 1 | # retrieved from https://osf.io/nipv5/?view_only=533e0b6a3003477fbb7d7dd147b91ef5 2 | 3 | library(pwr) 4 | library(sciplot) 5 | library(psych) 6 | library(brglm) 7 | library(ggplot2) 8 | library(boot) 9 | 10 | setwd("/Users/willgervais/Documents/Google Drive/Secrets/Research/Ongoing Projects/Power/Data & Code") 11 | 12 | 13 | ## Get Data 14 | 15 | Full <- read.table("PowerData.csv", header=T, sep=",") 16 | summary(Full) 17 | 18 | nrow(Full) 19 | 20 | 21 | Pow <- subset(Full, Choice < 1000) 22 | summary(Pow) 23 | 24 | nrow(Pow) 25 | 26 | 27 | 28 | 29 | 30 | ############################################# 31 | ####### Confirmatory Analyses: ############## 32 | #### Tests of Registered Hypotheses ######### 33 | ############################################# 34 | 35 | 36 | ########################################## 37 | ###### Hyp 1: Candidate Choices ######### 38 | ##### Will Differ Across Conditions ###### 39 | ########################################## 40 | 41 | 42 | ## Does introducing power information change preferences? 43 | 44 | 45 | ## 2 x 3 chi square 46 | 47 | X23 <- table(Pow$Choice, Pow$Condition) 48 | chisq.test(X23) 49 | 50 | 51 | 52 | ##################################### 53 | #### Pairwise Comparisons ########### 54 | ##################################### 55 | 56 | 57 | ##################################### 58 | #### Hyp 2: Order of Preference ##### 59 | ## For High Power Candidate Pattern # 60 | ## Findings < SS <<< Consequences ### 61 | ##################################### 62 | 63 | # Findings Vs. Sample size 64 | 65 | FS <- subset(Pow, Condition != "Consequences") 66 | summary(FS) 67 | 68 | FS.log <- glm(Choice ~ CondNum, data= FS, family= binomial) 69 | summary(FS.log) 70 | exp(coef(FS.log)) 71 | exp(confint(FS.log)) 72 | 73 | # Findings Vs. Consequences 74 | 75 | FC <- subset(Pow, Condition != "Sample Size") 76 | FC$CondNum <- FC$CondNum/2 77 | summary(FC) 78 | 79 | FC.log <- brglm(Choice ~ CondNum, data= FC, family= binomial) 80 | summary(FC.log) 81 | exp(coef(FC.log)) 82 | exp(confint(FC.log)) 83 | 84 | 85 | # SampleSize Vs. Consequences 86 | 87 | SC <- subset(Pow, Condition != "Findings") 88 | SC$CondNum <- SC$CondNum-1 89 | summary(SC) 90 | 91 | SC.log <- brglm(Choice ~ CondNum, data= SC, family= binomial) 92 | summary(SC.log) 93 | exp(coef(SC.log)) 94 | exp(confint(SC.log)) 95 | 96 | ########################################### 97 | ############ Check preferences ############ 98 | ########## within each condition ########## 99 | ########################################### 100 | 101 | 102 | ########################################### 103 | ##### Hyp 3: PPTS will significantly ###### 104 | #### prefer low-power candidate in the #### 105 | ## Findings and Sample Size Conditions. ### 106 | ###### This preference reverses in ######## 107 | ###### the Consequences condition ######### 108 | ########################################### 109 | 110 | Choices <- table(Pow$Choice, Pow$Condition) 111 | prop.table(Choices, 2) 112 | Choices 113 | 114 | 115 | # dif from chance wintin each condition??? 116 | 117 | 118 | Findings <- subset(Pow, Condition == "Findings") 119 | SS <- subset(Pow, Condition == "Sample Size") 120 | Cons <- subset(Pow, Condition == "Consequences") 121 | 122 | 123 | #Findings 124 | 125 | F0 <- subset(Findings, Choice == "0") 126 | F1 <- subset(Findings, Choice == "1") 127 | 128 | F0b <- describe(F0$Choice) 129 | F1b <- describe(F1$Choice) 130 | 131 | binom.test(F1b$n, F1b$n + F0b$n, p = .5) 132 | 133 | #Sample Size 134 | 135 | SS0 <- subset(SS, Choice == "0") 136 | SS1 <- subset(SS, Choice == "1") 137 | 138 | SS0b <- describe(SS0$Choice) 139 | SS1b <- describe(SS1$Choice) 140 | 141 | binom.test(SS1b$n, SS1b$n + SS0b$n, p = .5) 142 | 143 | 144 | #Consequences 145 | 146 | Cons0 <- subset(Cons, Choice == "0") 147 | Cons1 <- subset(Cons, Choice == "1") 148 | 149 | Cons0b <- describe(Cons0$Choice) 150 | Cons1b <- describe(Cons1$Choice) 151 | 152 | binom.test(Cons1b$n, Cons1b$n + Cons0b$n, p = .5) 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | ######################################## 166 | ######################################## 167 | ### Exploratory and Descriptive Stuff ## 168 | ######################################## 169 | ######################################## 170 | 171 | 172 | 173 | ######################## 174 | ##### Describe ######### 175 | ## research Practices### 176 | ######################## 177 | 178 | 179 | ##Low 180 | 181 | describe(Pow$NyearLow) 182 | 183 | describe(Pow$DtypicalLow) 184 | 185 | describe(Pow$NconditionLow) 186 | 187 | describe(Pow$PcorrectLow) 188 | 189 | 190 | ##High 191 | 192 | describe(Pow$NyearHigh) 193 | 194 | describe(Pow$DtypicalHigh) 195 | 196 | describe(Pow$NconditionHigh) 197 | 198 | describe(Pow$PcorrectHigh) 199 | 200 | 201 | 202 | ############################################## 203 | #### Calculate power, false pos rate, and #### 204 | ### replication rates from provided info ##### 205 | ############################################## 206 | 207 | 208 | ##Using highest provided estimate 209 | 210 | 211 | powerHigh <- power.t.test(d=Pow$DtypicalHigh, power= NULL, n= Pow$NconditionHigh, sig.level=.05, alternative="two.sided") 212 | 213 | Pow$N2.5 <- Pow$NconditionHigh * 2.5 214 | 215 | 216 | powerHigh2.5 <- power.t.test(d=Pow$DtypicalHigh, power= NULL, n= Pow$N2.5, sig.level=.05, alternative="two.sided") 217 | 218 | 219 | Pow$PowerTypicalHigh <- powerHigh$power 220 | 221 | 222 | Pow$PowerTypicalHigh2.5 <- powerHigh2.5$power 223 | 224 | 225 | rightHigh <- Pow$PcorrectHigh * Pow$PowerTypicalHigh 226 | 227 | wrongHigh <- (1-Pow$PcorrectHigh)* .05 228 | 229 | sigrateHigh <- rightHigh + wrongHigh 230 | 231 | 232 | Pow$fprateHigh <- wrongHigh/sigrateHigh 233 | 234 | Pow$reprateHigh <- ((1-Pow$fprateHigh) * Pow$PowerTypicalHigh) + (Pow$fprateHigh * .05) 235 | 236 | Pow$reprateHigh2.5 <- ((1-Pow$fprateHigh) * Pow$PowerTypicalHigh2.5) + (Pow$fprateHigh * .05) 237 | 238 | 239 | 240 | 241 | 242 | Pow$Power50 <- ifelse(Pow$PowerTypicalHigh <= .5, 1, 0) 243 | Pow$Power80 <- ifelse(Pow$PowerTypicalHigh <= .8, 1, 0) 244 | Pow$reprate50 <- ifelse(Pow$reprateHigh <= .5, 1, 0) 245 | 246 | Pow$reprate50.2.5 <- ifelse(Pow$reprateHigh2.5 <= .5, 1, 0) 247 | 248 | myvars <- c("PowerTypicalHigh" ,"fprateHigh", "reprateHigh", "reprateHigh2.5", "Power50", "Power80", "reprate50","reprate50.2.5") 249 | PracticesHigh <- Pow[myvars] 250 | 251 | 252 | describe(PracticesHigh) 253 | 254 | NHigh <- describe(Pow$NconditionHigh) 255 | PHigh <- describe(Pow$PowerTypicalHigh) 256 | fHigh <- describe(Pow$fprateHigh) 257 | rHigh <- describe(Pow$reprateHigh) 258 | 259 | 260 | par(mfrow=c(2,2)) 261 | 262 | n <- density(Pow$NconditionHigh, na.rm=TRUE) 263 | plot(n, main="N per conditon", xlim= c(0, 150)) 264 | polygon(n, col="cornflowerblue", border="black") 265 | abline(v=NHigh$median, lty=3, col="green") 266 | 267 | 268 | pwr <- density(Pow$PowerTypicalHigh, na.rm=TRUE) 269 | plot(pwr, main="Power", xlim= c(0, 1)) 270 | polygon(pwr, col="cornflowerblue", border="black") 271 | abline(v=PHigh$median, lty=3, col="green") 272 | 273 | 274 | 275 | fp <- density(Pow$fprateHigh, na.rm=TRUE) 276 | plot(fp, main="False Positive Rate", xlim= c(0, 1)) 277 | polygon(fp, col="cornflowerblue", border="black") 278 | abline(v=fHigh$median, lty=3, col="green") 279 | 280 | 281 | rep <- density(Pow$reprateHigh, na.rm=TRUE) 282 | plot(rep, main="Replication Rate", xlim= c(0, 1)) 283 | polygon(rep, col="cornflowerblue", border="black") 284 | abline(v=rHigh$median, lty=3, col="green") 285 | 286 | 287 | ###################################### 288 | ######### Exploratory Analyses: ###### 289 | #### to see if institution, rank ##### 290 | ## or practices (N & Power) predict ## 291 | ###### choice of candidates ########## 292 | ###################################### 293 | 294 | ## Does the effect differ by academic rank? 295 | 296 | 297 | Pow$N10 <- Pow$NconditionHigh/10 298 | Pow$Pow10 <- Pow$PowerTypicalHigh/10 299 | 300 | Findings <- subset(Pow, Condition == "Findings") 301 | SS <- subset(Pow, Condition == "Sample Size") 302 | Cons <- subset(Pow, Condition == "Consequences") 303 | 304 | 305 | 306 | FRank <- table(Findings$Choice, Findings$RankID) 307 | chisq.test(FRank) 308 | 309 | 310 | SSRank <- table(SS$Choice, SS$RankID) 311 | chisq.test(SSRank) 312 | 313 | CRank <- table(Cons$Choice, Cons$RankID) 314 | chisq.test(CRank) 315 | 316 | 317 | 318 | ## Does the effect differ by institution? 319 | 320 | 321 | FInst <- table(Findings$Choice, Findings$InstID) 322 | chisq.test(FInst) 323 | 324 | 325 | SSInst <- table(SS$Choice, SS$InstID) 326 | chisq.test(SSInst) 327 | 328 | CInst <- table(Cons$Choice, Cons$InstID) 329 | chisq.test(CInst) 330 | 331 | 332 | ## Does a participant's typical sample size relate to preferences when sample size is given? Consequences? 333 | 334 | 335 | 336 | 337 | 338 | 339 | NS.log <- glm(Choice ~ N10, data=SS, family = binomial) 340 | summary(NS.log) 341 | exp(coef(NS.log)) 342 | exp(confint(NS.log)) 343 | 344 | 345 | NC.log <- glm(Choice ~ N10, data=Cons, family = binomial) 346 | summary(NC.log) 347 | exp(coef(NC.log)) 348 | exp(confint(NC.log)) 349 | 350 | 351 | ## Does participant typical power relate to decisions? 352 | 353 | 354 | #scale power to .10 increments 355 | 356 | 357 | 358 | PS.log <- glm(Choice ~ Pow10, data=SS, family = binomial) 359 | summary(PS.log) 360 | exp(coef(PS.log)) 361 | exp(confint(PS.log)) 362 | 363 | 364 | PC.log <- brglm(Choice ~ Pow10, data=Cons, family = binomial) 365 | summary(PC.log) 366 | exp(coef(PC.log)) 367 | exp(confint(PC.log)) 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | ###################### 378 | ## Demographics ###### 379 | ###################### 380 | 381 | #Age 382 | describe(Pow$Age) 383 | 384 | #Gender 385 | Pow$Gender <- factor(Pow$GenFem, levels = c("0", "1", "2"), labels= c("Male", "Female", "Other")) 386 | 387 | GenTab <- table(Pow$Gender) 388 | prop.table(GenTab) 389 | 390 | #Institution 391 | 392 | Pow$Institution <- factor(Pow$InstID, levels = c("1", "2", "3", "4", "5"), labels = c("R1", "R2", "MA", "SLAC", "Other")) 393 | 394 | InTab <- table(Pow$Institution) 395 | prop.table(InTab) 396 | 397 | #Rank 398 | 399 | Pow$Rank <- factor(Pow$RankID, levels = c("1", "2", "3", "4", "5"), labels = c("Assistant", "Associate", "Full", "Emeritus", "Other")) 400 | 401 | RTab <- table(Pow$Rank) 402 | prop.table(RTab) 403 | 404 | 405 | 406 | #### Graph it #### 407 | # Fig 2 408 | 409 | Condition = c("Findings", "Sample Size", "Consequences") 410 | prob = c(.217, .610, .966) 411 | lcl = c(.121, .474, .880) 412 | ucl = c(.342, .735, .996) 413 | dat <- data.frame(Condition, prob, lcl, ucl) 414 | 415 | summary(dat) 416 | 417 | dat$Cond <- factor(dat$Condition, levels = c("Findings", "Sample Size", "Consequences")) 418 | 419 | quartz() 420 | ggplot(data=dat, aes(x= Cond, y = prob, ymin = lcl, ymax=ucl)) + geom_pointrange(col="black", size=.666) + labs(x= "\nCondition", y = "Proportion Choosing \nLarger Sample Size Candidate \n ", title="Hiring Preferences \n") + theme_bw() + scale_y_continuous(breaks = c(0, .25, .5, .75, 1)) + geom_hline(yintercept=.5, lty=3, col="darkgrey") + geom_hline(yintercept=0, lty=1, col="darkgrey") + geom_hline(yintercept=1, lty=1, col="darkgrey") + theme(plot.title = element_text(size = rel(1.2), face="bold")) 421 | 422 | 423 | 424 | 425 | -------------------------------------------------------------------------------- /original code from others/Roth-IQ.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/original code from others/Roth-IQ.ods -------------------------------------------------------------------------------- /original code from others/Shanks Meta-analysis_data.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/original code from others/Shanks Meta-analysis_data.xlsx -------------------------------------------------------------------------------- /original code from others/Simonsohn_p-curve-code.R: -------------------------------------------------------------------------------- 1 | 2 | #R Code running behind p-curve.com/App3 3 | #Written by Uri Simonsohn (uws@wharton.upenn.edu) 4 | #This version: 2015 03 02 5 | # 6 | # <-- PLEASE CONTACT ME DIRECTLY IF YOU SEE ANY ERRORS OR HAVE SUGGESTIONS --> 7 | 8 | # Note: 9 | #The code below has some redundancies because it merges code written for two different papers 10 | #Some of the clunkiness of the code (e.g., how results are reported) arises because the code 11 | #was written to run on a server and save results that are then presented on a website. 12 | #It was adapted to be run on a personal computer introducing the least # of changes possible to the code. 13 | # 14 | 15 | ############################################################################################################ 16 | 17 | # R E A D M E # 18 | # (---------(0)------------(0)---------------) 19 | 20 | #ENTER/LOAD YOUR TEST RESULTS HERE: (USE THIS SYNTAX) 21 | tests = c("t(88)=2.1", 22 | "r(147)=.246", 23 | "F(1,100)=9.1", 24 | "f(2,210)=4.45", 25 | "Z=3.45", 26 | "chi2(1)=9.1", 27 | "r(77)=.47", 28 | "chi2(2)=8.74") 29 | 30 | #RUN ALL CODE UP TO #14 TO GET MAIN RESULTS, P-CURVE CHART, AND POWER CHART 31 | #THEN RUN CODE #15 TO GET THE CUMULATIVE P-CURVE (DROPPING STUDIES) 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | ############################################################################################################ 40 | 41 | #Load libraries necessary to run programs 42 | library(stringr) #Library to process string variables (text of the entered tests) 43 | library(poibin) #This library has the Poisson binomial, the distribution of the sum of binomial with different 44 | #underlying probabilities used to compute the binomial test given that each test has a (slightly) 45 | #different probability of p<.025 depending on its own non-central parameter 46 | #See Hong (2013) - "On computing the distribution function for the Poisson binomial distribution" Computational 47 | #Statistics and Data Analysis, V59, p.41-51 - http://dx.doi.org/10.1016/j.csda.2012.10.006 48 | 49 | 50 | #1. create empty vectors for 51 | #1.1 pp-values 52 | t.ppr=f.ppr=c.ppr=z.ppr=c(); #right skew 53 | t.ppl=f.ppl=c.ppl=z.ppl=c(); #left 54 | t.pp33=f.pp33=c.pp33=z.pp33=c(); #33% 55 | 56 | #1.2 proportions expected to be low (p<.025) for each test 57 | t.plow=f.plow=c.plow=z.plow=c() 58 | 59 | #1.3 proportions for all tests are 0 so that if a type of test is missing we know it is not there when aggregating 60 | t.prop1=t.prop2=t.prop3=t.prop4=t.prop5=0; 61 | f.prop1=f.prop2=f.prop3=f.prop4=f.prop5=0; 62 | z.prop1=z.prop2=z.prop3=z.prop4=z.prop5=0; 63 | c.prop1=c.prop2=c.prop3=c.prop4=c.prop5=0; 64 | 65 | 66 | #1.4 Function 1 - functions that find noncentrality parameter for t,f,chi distributions that gives 33% power for those d.f. 67 | 68 | #t-test 69 | ncp33t =function(df) 70 | { 71 | xc=qt(p=1-.05/2, df=df) 72 | #Find noncentrality parameter (ncp) that leads 33% power to obtain xc 73 | f = function(delta, pr, x, df) pt(x, df = df, ncp = delta) - 2/3 74 | out = uniroot(f, c(0, 37.62), x = xc, df = df) 75 | return(out$root) 76 | } 77 | 78 | #F-test 79 | ncp33f =function(df1,df2) 80 | { 81 | xc=qf(p=1-.05,df1=df1,df2=df2) 82 | f = function(delta, pr, x, df1,df2) pf(x, df1 = df1, df2=df2, ncp = delta) - 2/3 83 | out = uniroot(f, c(0, 37.62), x = xc, df1=df1, df2=df2) 84 | return(out$root) 85 | } 86 | 87 | #chi-square 88 | ncp33chi =function(df) 89 | { 90 | xc=qchisq(p=1-.05, df=df) 91 | #Find noncentrality parameter (ncp) that leads 33% power to obtain xc 92 | f = function(delta, pr, x, df) pchisq(x, df = df, ncp = delta) - 2/3 93 | out = uniroot(f, c(0, 37.62), x = xc, df = df) 94 | return(out$root) 95 | } 96 | 97 | 98 | ############################################################################### 99 | 100 | #Function 2 - percent() : makes a number look like a percentage 101 | percent <- function(x, digits = 0, format = "f", ...) { 102 | paste(formatC(100 * x, format = format, digits = digits, ...), "%", sep = "") 103 | } 104 | ############################################################################### 105 | 106 | #Create a "backup" so that final results table includes the n.s. results which will be excluded from most calculations 107 | #(not really important here, key for the online app) 108 | k=seq(from=1,to=length(tests)) 109 | backup=cbind(k,tests) 110 | 111 | #(2) Split tests into t,F,X2 and Z 112 | 113 | #2.1 Turn everything to lower case 114 | tests=tolower(tests) 115 | 116 | #2.2 Extract the type of test (stat={t,F,c,Z) 117 | stat=substring(tests,1,1) 118 | 119 | #2.3 Split vector of tests into these 120 | #get the t-tests 121 | t.text=subset(tests,stat=="t") 122 | #get the f-tests 123 | f.text=subset(tests,stat=="f") 124 | #get the chi2 125 | c.text=subset(tests,stat=="c" | stat=="x") 126 | #get the Z (normally distributed) 127 | z.text=subset(tests,stat=="z") 128 | #get the r (correlation) 129 | r.text=subset(tests,stat=="r") 130 | 131 | #3 Get d.f. for the tests 132 | #3.1 t-test 133 | #find the 2nd parenthesis 134 | t.par=str_locate(t.text,")")[,1] 135 | #Get the d.f. between both parenthesis 136 | t.df=as.numeric(substring(t.text,3,t.par -1)) 137 | 138 | #3.2 f-test 139 | #find the comma 140 | f.comma=str_locate(f.text,",")[,1] 141 | #find the 2nd parenthesis 142 | f.par=str_locate(f.text,")")[,1] 143 | #Get the df1 (between "(" and "," 144 | f.df1=as.numeric(substring(f.text,3,f.comma -1)) 145 | #Get the df2 (between "," and ")" 146 | f.df2=as.numeric(substring(f.text,f.comma +1,f.par -1)) 147 | 148 | #3.3 Chi-square 149 | #find the 1st parenthesis 150 | c.par1=str_locate(c.text,"\\(")[,1] 151 | #find the 2nd parenthesis 152 | c.par2=str_locate(c.text,")")[,1] 153 | #Get the d.f. between both parenthesis 154 | c.df=as.numeric(substring(c.text,c.par1+1,c.par2 -1)) 155 | 156 | #3.4 Correlations 157 | #fine the 2nd parenthesis 158 | r.par=str_locate(r.text,")")[,1] 159 | #Get the d.f. between both parenthesis 160 | r.df=as.numeric(substring(r.text,3,r.par -1)) 161 | 162 | 163 | #4 Get the test values 164 | #4.1 Find the "=" sign 165 | t.eq=str_locate(t.text,"=")[,1] 166 | f.eq=str_locate(f.text,"=")[,1] 167 | z.eq=str_locate(z.text,"=")[,1] 168 | c.eq=str_locate(c.text,"=")[,1] 169 | r.eq=str_locate(r.text,"=")[,1] 170 | 171 | #4.2 Get the number after the = 172 | t.value=c();r.value=c() 173 | 174 | t.value=as.numeric(substring(t.text,t.eq+1,)) 175 | f.value=as.numeric(substring(f.text,f.eq+1,)) 176 | z.value=as.numeric(substring(z.text,z.eq+1,)) 177 | c.value=as.numeric(substring(c.text,c.eq+1,)) 178 | r.value=as.numeric(substring(r.text,r.eq+1,)) 179 | 180 | #4.3 merge r() with t-tests 181 | rt.value=r.value/(sqrt((1-r.value**2)/r.df)) #r() expressed as a t-value 182 | t.value=c(t.value,rt.value) 183 | t.df=c(t.df,r.df) 184 | t.text=c(t.text,r.text) 185 | 186 | 187 | #5 Keep significant p-values 188 | #Compute p-values 189 | t.p=2*(1-pt(abs(t.value),df=t.df)) 190 | f.p=1-pf(abs(f.value),df1=f.df1,df2=f.df2) 191 | z.p=2*(1-pnorm(abs(z.value))) 192 | c.p=1-pchisq(abs(c.value),df=c.df) 193 | 194 | #Subset statistics and d.f. 195 | #ts 196 | t.value.sig=subset(t.value,t.p<.05) 197 | t.df.sig =subset(t.df, t.p<.05) 198 | t.text.sig =subset(t.text, t.p<.05) 199 | t.p.sig =subset(t.p, t.p<.05) 200 | #fs 201 | f.value.sig=subset(f.value,f.p<.05) 202 | f.df1.sig =subset(f.df1, f.p<.05) 203 | f.df2.sig =subset(f.df2, f.p<.05) 204 | f.text.sig =subset(f.text, f.p<.05) 205 | f.p.sig =subset(f.p, f.p<.05) 206 | #chis 207 | c.value.sig=subset(c.value,c.p<.05) 208 | c.df.sig =subset(c.df, c.p<.05) 209 | c.text.sig =subset(c.text, c.p<.05) 210 | c.p.sig =subset(c.p, c.p<.05) 211 | #zs 212 | z.value.sig=subset(z.value,z.p<.05) 213 | z.text.sig =subset(z.text, z.p<.05) 214 | z.p.sig =subset(z.p, z.p<.05) 215 | 216 | #All significant p-values (used for binomial) 217 | all.p.sig=c(t.p.sig, f.p.sig, c.p.sig, z.p.sig) 218 | #Number of significant results 219 | ktot=length(all.p.sig) 220 | #Number of non-signifcant results in p-curve 221 | kns=length(tests)-ktot 222 | 223 | #6 Compute pp-values 224 | #6.1 For t-values 225 | if (length(t.value.sig)>0) #if nonempty compute pp-values 226 | { 227 | #skew 228 | t.ppr=t.p.sig*(1/.05) #pp-value for right-skew 229 | t.ppl=1-t.ppr #pp-value for left-skew 230 | #33%power 231 | #Find the ncp (uses function from top) 232 | t.ncp33=mapply(ncp33t,t.df.sig) 233 | #Using the ncp33 compute pp33. 234 | t.pp33=3*(pt(t.value.sig, df=t.df.sig, ncp=t.ncp33)-2/3) 235 | } 236 | 237 | #6.2 For F-values 238 | if (length(f.value.sig)>0) #if nonempty compute pp-values 239 | { 240 | f.ppr=f.p.sig*(1/.05) #pp-value for right-skew 241 | f.ppl=1-f.ppr #pp-value for left-skew 242 | f.ncp33=mapply(ncp33f, f.df1.sig, f.df2.sig) 243 | f.pp33 =3*(pf(f.value.sig, df1=f.df1.sig, df2=f.df2.sig, ncp=f.ncp33)-2/3) 244 | } 245 | 246 | #6.3 z-values 247 | if (length(z.value.sig)>0) #if nonempty compute pp-values 248 | { 249 | z.ppr=z.p.sig*(1/.05) 250 | z.ppl=1-z.ppr 251 | z.pp33=3*(pnorm(z.value.sig,mean=1.5285687,sd=1)-2/3) #Compute pp33-values using the 'ncp' 1.5285687 which gives the normal 33% power 252 | 253 | } 254 | 255 | #6.4 chi-values 256 | if (length(c.value.sig)>0) #if nonempty compute pp-values 257 | { 258 | c.ppr=c.p.sig*(1/.05) 259 | c.ppl=1-c.ppr 260 | c.ncp33=mapply(ncp33chi, c.df.sig) 261 | c.pp33=3*(pchisq(c.value.sig, df=c.df.sig, ncp=c.ncp33)-2/3) 262 | } 263 | 264 | 265 | #7 STOUFFER: Overall tests aggregating pp-values (using Fisher's method to aggregate uniform distributions of (p)p-values) 266 | #7.1 Convert pp-values to Z scores, aggregate them and divide by sqrt(ktot) 267 | Zppr =sum(qnorm(c(t.ppr, f.ppr ,c.ppr, z.ppr )))/sqrt(ktot) #right skew 268 | Zppl =sum(qnorm(c(t.ppl, f.ppl ,c.ppl, z.ppl )))/sqrt(ktot) #left skew 269 | Zpp33=sum(qnorm(c(t.pp33, f.pp33 ,c.pp33, z.pp33)))/sqrt(ktot) #33% 270 | 271 | #7.2 Compute overall p-values 272 | p.Zppr =pnorm(Zppr) 273 | p.Zppl =pnorm(Zppl) 274 | p.Zpp33=pnorm(Zpp33) 275 | 276 | 277 | #8 Green line (Expected p-curve for 33% power) 278 | #8.1 t-tests 279 | if (length(t.value.sig)>0) #if nonempty compute pp-values 280 | { 281 | #Critical values,xc, for p=.05, .04, .03, .02 and ,01 282 | t.x5=qt(.975,df=t.df.sig); t.x4=qt(.98, df=t.df.sig); t.x3=qt(.985,df=t.df.sig); 283 | t.x2=qt(.99, df=t.df.sig); t.x1=qt(.995,df=t.df.sig) 284 | #For Binomial test 285 | t.x25=qt(.9875,df=t.df.sig) #critical value for t-tests to get p=.025 286 | t.plow=1- 3*(pt(t.x25,df=t.df.sig, ncp=t.ncp33)-2/3) #prob(p<.025 | ncp33% & p<.05) 287 | 288 | #Probabilty of a p-value bigger p=.05, .04, .03, .02 and .01 given p<.05 and ncp=ncp33 289 | t.pp4=3*(pt(t.x4,df=t.df.sig, ncp=t.ncp33)-2/3) 290 | t.pp3=3*(pt(t.x3,df=t.df.sig, ncp=t.ncp33)-2/3) 291 | t.pp2=3*(pt(t.x2,df=t.df.sig, ncp=t.ncp33)-2/3) 292 | t.pp1=3*(pt(t.x1,df=t.df.sig, ncp=t.ncp33)-2/3) 293 | #within bins proportions 294 | t.prop5=mean(t.pp4); 295 | t.prop4=mean(t.pp3-t.pp4); 296 | t.prop3=mean(t.pp2-t.pp3); 297 | t.prop2=mean(t.pp1-t.pp2); 298 | t.prop1=mean(1-t.pp1) 299 | } 300 | #8.2 f-tests 301 | if (length(f.value.sig)>0) #if nonempty compute pp-values 302 | { 303 | #Critical values,xc, for p=.05, .04, .03, .02 and ,01 304 | f.x5=qf(.95,df1=f.df1.sig, df2=f.df2.sig); f.x4=qf(.96,df1=f.df1.sig, df2=f.df2.sig); f.x3=qf(.97,,df1=f.df1.sig, df2=f.df2.sig); 305 | f.x2=qf(.98, df1=f.df1.sig, df2=f.df2.sig); f.x1=qf(.99,df1=f.df1.sig, df2=f.df2.sig) 306 | #For binomial test 307 | f.x25 =qf(.975,df1=f.df1.sig, df2=f.df2.sig) #Critical F value for p=.025 308 | f.plow=1-3*(pf(f.x25,df1=f.df1.sig, df2=f.df2.sig, ncp=f.ncp33)-2/3) #Prob(p<.025|ncp33% & p<.05) 309 | 310 | 311 | #Probabilty of a p-value bigger p=.05, .04, .03, .02 and .01 given p<.05 and ncp=ncp33 312 | f.pp4=3*(pf(f.x4,df1=f.df1.sig, df2=f.df2.sig, ncp=f.ncp33)-2/3) 313 | f.pp3=3*(pf(f.x3,df1=f.df1.sig, df2=f.df2.sig, ncp=f.ncp33)-2/3) 314 | f.pp2=3*(pf(f.x2,df1=f.df1.sig, df2=f.df2.sig, ncp=f.ncp33)-2/3) 315 | f.pp1=3*(pf(f.x1,df1=f.df1.sig, df2=f.df2.sig, ncp=f.ncp33)-2/3) 316 | 317 | #within bins proportions 318 | f.prop5=mean(f.pp4); 319 | f.prop4=mean(f.pp3-f.pp4); 320 | f.prop3=mean(f.pp2-f.pp3); 321 | f.prop2=mean(f.pp1-f.pp2); 322 | f.prop1=mean(1-f.pp1) 323 | } 324 | #8.3 chi-tests 325 | if (length(c.value.sig)>0) #if nonempty compute pp-values 326 | { 327 | 328 | #Critical values,xc, for p=.05, .04, .03, .02 and ,01 329 | c.x5=qchisq(.95,df=c.df.sig); c.x4=qchisq(.96, df=c.df.sig); c.x3=qchisq(.97,df=c.df.sig); 330 | c.x2=qchisq(.98, df=c.df.sig); c.x1=qchisq(.99,df=c.df.sig) 331 | 332 | #For binomial test 333 | c.x25 =qchisq(.975,df=c.df.sig) #Critical x2 value for p=.025 334 | c.plow=1-3*(pchisq(c.x25,df=c.df.sig, ncp=c.ncp33)-2/3) #Prob(p<.025|ncp33% & p<.05) 335 | 336 | #Probabilty of a p-value bigger p=.05, .04, .03, .02 and .01 given p<.05 and ncp=ncp33 337 | c.pp4=3*(pchisq(c.x4,df=c.df.sig, ncp=c.ncp33)-2/3) 338 | c.pp3=3*(pchisq(c.x3,df=c.df.sig, ncp=c.ncp33)-2/3) 339 | c.pp2=3*(pchisq(c.x2,df=c.df.sig, ncp=c.ncp33)-2/3) 340 | c.pp1=3*(pchisq(c.x1,df=c.df.sig, ncp=c.ncp33)-2/3) 341 | 342 | #within bins proportions 343 | c.prop5=mean(c.pp4); c.prop4=mean(c.pp3-c.pp4); c.prop3=mean(c.pp2-c.pp3); 344 | c.prop2=mean(c.pp1-c.pp2); c.prop1=mean(1-c.pp1) 345 | } 346 | #8.4 z-tests 347 | if (length(z.value.sig)>0) #if nonempty compute pp-values 348 | { 349 | #Critical values,xc, for p=.05, .04, .03, .02 and ,01 350 | z.x5=qnorm(.975); z.x4=qnorm(.98); z.x3=qnorm(.985); z.x2=qnorm(.99); z.x1=qnorm(.995) 351 | # For Binomial test 352 | z.x25 =qnorm(.9825) #Critical x2 value for p=.025 353 | z.plow=1-3*(pnorm(z.x25,mean=1.5285687,sd=1)-2/3) #Prob(p<.025|ncp33% & p<.05) 354 | #Probabilty of a p-value bigger p=.05, .04, .03, .02 and .01, given p<.05 and ncp=ncp33 355 | z.pp4=3*(pnorm(z.x4,mean=1.5285687,sd=1)-2/3) 356 | z.pp3=3*(pnorm(z.x3,mean=1.5285687,sd=1)-2/3) 357 | z.pp2=3*(pnorm(z.x2,mean=1.5285687,sd=1)-2/3) 358 | z.pp1=3*(pnorm(z.x1,mean=1.5285687,sd=1)-2/3) 359 | #within bins proportions 360 | z.prop5=z.pp4; z.prop4=z.pp3-z.pp4; z.prop3=z.pp2-z.pp3; z.prop2=z.pp1-z.pp2; z.prop1=1-z.pp1 361 | } 362 | 363 | 364 | #9 combine t,F,chi,Z 365 | #proportion of all tests that are of each type 366 | t.share=length(t.value.sig)/ktot 367 | f.share=length(f.value.sig)/ktot 368 | c.share=length(c.value.sig)/ktot 369 | z.share=length(z.value.sig)/ktot 370 | 371 | #Average proportions within the 4 types of tests 372 | t.props=c(t.prop1, t.prop2, t.prop3, t.prop4, t.prop5) 373 | f.props=c(f.prop1, f.prop2, f.prop3, f.prop4, f.prop5) 374 | c.props=c(c.prop1, c.prop2, c.prop3, c.prop4, c.prop5) 375 | z.props=c(z.prop1, z.prop2, z.prop3, z.prop4, z.prop5) 376 | 377 | #overall proportions (i.e.., THE GREEN LINE) 378 | green=100*(t.props*t.share + f.props*f.share + c.props*c.share + z.props*z.share) 379 | 380 | 381 | #10 The blue line (observed p-curve) 382 | 383 | #Put each p-value in a bin between 0 and .05 384 | ps=ceiling(c(all.p.sig)*100)/100 385 | #Count them 386 | blue01=sum(ps<=.01)/ktot; blue02=sum(ps==.02)/ktot; blue03=sum(ps==.03)/ktot; 387 | blue04=sum(ps==.04)/ktot; blue05=sum(ps==.05)/ktot; 388 | #combine 389 | blue=c(blue01,blue02,blue03,blue04,blue05)*100 390 | #Note: i could have used the Table command, but it is a pain if there are no p-value in a given range 391 | 392 | #11 Red line 393 | red=c(20,20,20,20,20) 394 | 395 | #12 Carry out binomial test 396 | #Note: for t and Z test, the critical value is for p=.0125 one sided, for Z and Chi2 it is for .025 two-sided 397 | 398 | 399 | #12.1 Combine the prob(p<.025) for each set of tests 400 | plows=c(t.plow, f.plow, c.plow, z.plow) 401 | #12.2 Compute observed shared of p<.025 results 402 | low.obs=sum(all.p.sig<=.025) 403 | #12.3 Right skew: Compare observed share p<.025 with null of 50:50 and altenrative of more p<.025 than expected 404 | binom.r=1-pbinom(q=low.obs-1, p=.5, size=ktot) #The binomial in R computes the probability of x<=xo. We want prob(x>=x0) so we subtract one from x, and 1-prob() 405 | #12.4 Left skew: Compare observed share p<.025 with null of 50:50 and altenrative of fewer p<.025 than expected 406 | binom.l=pbinom(q=low.obs, p=.5, size=ktot) #Here the default x<=x0 is what we want 407 | #12.5 33% power: Compare observed share p<.025 with expected share ~72% based on the combination of expected shares for ncp33% 408 | # The probability of p<.025|ncp33 is slightly different for each test, hence I use the poisson binomial distribtuion (see reference top of this document) 409 | binom.33=ppoibin(kk=low.obs,pp=plows) 410 | 411 | 412 | #13.POWER ESTIMATION 413 | 414 | #13.1 SET OF FUNCTIONS 1. COMPUTE GAP BETWEEN POWER AND DESIRED POWER FOR A GIVEN NCP 415 | # (minimize these in the next step to solve for the ncp that gives the desired power) 416 | ncp_error.t = function(delta, power, x, df) pt(x, df = df, ncp = delta) - (1-power) #if this equals 0, we found the ncp. 417 | ncp_error.f = function(delta, power, x, df1,df2) pf(x, df1 = df1, df2=df2, ncp = delta) - (1-power) 418 | ncp_error.c = function(delta, power, x, df) pchisq(x, df = df, ncp = delta) - (1-power) 419 | ncp_error.z = function(delta, power, x) pnorm(x, mean = delta,sd=1) - (1-power) 420 | 421 | #13.2 SET OF FUNCTIONS 2: MINIMIZE FUNCTIONS ABOVE 422 | #t-test 423 | getncp.t =function(df, power) { 424 | xc=qt(p=.975, df=df) # critical t-value 425 | return(uniroot(ncp_error.t, c(0, 37.62), x = xc, df =df, power=power)$root) } 426 | 427 | #F-test 428 | getncp.f =function(df1,df2, power) { 429 | xc=qf(p=.95, df1=df1,df2=df2) # critical F-value 430 | return(uniroot(ncp_error.f, c(0, 37.62), x = xc, df1 = df1,df2=df2, power=power)$root) } 431 | 432 | 433 | #chisq-test 434 | getncp.c =function(df, power) { 435 | xc=qchisq(p=.95, df=df) # critical c-value 436 | return(uniroot(ncp_error.c, c(0, 37.62), x = xc, df = df, power=power)$root) } 437 | 438 | #Normal 439 | getncp.z =function(power) { 440 | xc=qnorm(p=.975) # critical Z-value with df=1 441 | return(uniroot(ncp_error.z, c(0, 37.62), x = xc, power=power)$root) } 442 | 443 | # 13.3 CREATE PP-VALUES FOR EACH OF THE FOUR DISTRIBUTIONS FOR HOW WELL A GIVEN POWER_EST FITS 444 | powerfit.t=function(t_obs, df_obs, power_est) { 445 | ncp_est=mapply(getncp.t,df=df_obs,power=power_est) #find ncp for each that gives each test power.k 446 | p_larger=pt(t_obs,df=df_obs,ncp=ncp_est) #prob t>tobs given ncp_est 447 | ppr=(p_larger-(1-power_est))/power_est #condition on p<.05 448 | return(ppr) } 449 | 450 | powerfit.f=function(f_obs, df1_obs, df2_obs, power_est) { 451 | ncp_est=mapply(getncp.f,df1=df1_obs, df2=df2_obs,power=power_est) #find ncp for each that gives each test power.k 452 | p_larger=pf(f_obs,df1=df1_obs,df2=df2_obs, ncp=ncp_est) #prob t>tobs given ncp_est 453 | ppr=(p_larger-(1-power_est))/power_est #condition on p<.05 454 | return(ppr) } 455 | 456 | powerfit.z=function(z_obs, power_est) { 457 | ncp_est=mapply(getncp.z,power=power_est) 458 | p_larger=pnorm(z_obs,mean=ncp_est) 459 | ppr=(p_larger-(1-power_est))/power_est 460 | return(ppr) } 461 | 462 | 463 | powerfit.c=function(c_obs, df_obs, power_est) { 464 | ncp_est=mapply(getncp.c,df=df_obs,power=power_est) 465 | p_larger=pchisq(c_obs,df=df_obs,ncp=ncp_est) 466 | ppr=(p_larger-(1-power_est))/power_est 467 | return(ppr) } 468 | 469 | #13.4 STACK-UP ALL THE PP-VALUES INTO A VECTOR AND COMPARE THEM TO UNIFORM DISTRIBUTION USING KOLMOGOROV-SMIRNOV TEST 470 | 471 | powerfit.all=function(power_est) 472 | { 473 | ppr.all=c() 474 | #for each kind of test, check if there are any significant values, if there are, add ppr to overall ppr 475 | if (length(t.value.sig)>0) ppr.all=c(ppr.all, powerfit.t(t_obs=t.value.sig, df_obs=t.df.sig, power_est=power_est)) 476 | if (length(f.value.sig)>0) ppr.all=c(ppr.all, powerfit.f(f_obs=f.value.sig, df1_obs=f.df1.sig, df2_obs=f.df2.sig, power_est=power_est)) 477 | if (length(z.value.sig)>0) ppr.all=c(ppr.all, powerfit.z(z_obs=z.value.sig, power_est=power_est)) 478 | if (length(c.value.sig)>0) ppr.all=c(ppr.all, powerfit.c(c_obs=c.value.sig, df_obs=c.df.sig, power_est=power_est)) 479 | KSD=ks.test(ppr.all,punif)$statistic #KS test on the resulting pprs 480 | return(KSD) 481 | } 482 | 483 | #13.5 FUNCTION THAT COMPUTES FIT FOR EACH LEVEL OF POWER, AND PLOT IT 484 | 485 | 486 | plotfit=function() 487 | { 488 | # Fit will be evaluated at every possible value of power between 5.1% and 99% in steps of 1%, stored in fit() 489 | fit=c() #Create empty vector 490 | fit=powerfit.all(.051) #First evaluate fit for power of 5.1%, the lowest one can get for non-directional tests like x2 and F 491 | for (i in 6:99) fit=c(fit,powerfit.all(i/100)) #Now do 6% to 99% 492 | # Find the minimum 493 | mini=match(min(fit),fit) #which ith power level considered leads to best estimate 494 | hat=(mini+4)/100 #convert that into the power level, the ith value considered is (5+ith)/100 495 | #Plot results 496 | #create the x-axis 497 | x.power=seq(from=5,to=99)/100 498 | #Draw the line 499 | par(mar=c(5.1,8.1,4.1,2.1)) 500 | plot(x.power,fit,xlab="Underlying Power", ylab="",ylim=c(0,1), main="") 501 | #Make red dot at the estimate 502 | points(hat,min(fit),pch=19,col="red",cex=2) 503 | #Put a label with the estimate value 504 | sign="=" 505 | if (hat<.06) sign="<" 506 | text(min(.7,max(.28,hat)),min(fit)-.1,paste0("Estimated Power ",sign," ",hat*100,"%")) 507 | mtext(c("Perfect","Terrible"),side=2,line=3,at=c(0,1),las=1,cex=1.25,col=c("blue","red")) 508 | mtext("How Good Is the Fit?",side=2,line=6.5,cex=1.5) 509 | mtext("(Kolmogorov-Smirnov D Stat)",side=2,line=5.5,col="gray") 510 | mtext("Do we have a good estimate of power?",side=3,line=1.75,cex=1.5,at=0.4) 511 | mtext("If you see a V-Shape with a low minimum-->yes",side=3,line=0.5,cex=1.25,at=0.4) 512 | 513 | } 514 | 515 | #Create two graphs in a single chart 516 | par(mfrow=c(2,1)) 517 | 518 | #14 Firest the p-curve itself 519 | #Define x-axis as p-values (.01, .02..) 520 | x = c(.01,.02,.03,.04,.05) 521 | 522 | #Plot the observed p-curve 523 | 524 | plot(x,blue, type='l', col='dodgerblue2', main="",lwd=2, xlab="", ylab="", 525 | xaxt="n",yaxt="n", xlim=c(0.01,0.055), ylim=c(0,105), bty='L', las=1); 526 | 527 | #x-axis value labels 528 | x_=c(".01",".02",".03",".04",".05") 529 | axis(1,at=x,labels=x_) 530 | #y-axis value labels 531 | y_=c("0%","25%","50%","75%","100%") 532 | y=c(0,25,50,75,100) 533 | axis(2,at=y,labels=y_,las=1,cex.axis=.75) 534 | 535 | #Add y-axis label 536 | mtext("Percentage of test results",font=2,side=2,line=2.75,cex=1.25) 537 | #Add y-axis label 538 | mtext("p ",font=4,side=1,line=2.5,cex=1.25) 539 | mtext(" -value",font=2,side=1,line=2.5,cex=1.25) 540 | 541 | 542 | #Add little point in actual frequencies 543 | points(x,blue,type="p",pch=20,bg="dodgerblue2",col="dodgerblue2") 544 | #Add value-labels 545 | text(x+.00075,blue+5,percent(round(blue)/100),col='black', cex=.75) 546 | #Add red and green lines 547 | lines(x,red, type='l', col='firebrick2', lwd=1.5, lty=3) 548 | lines(x,green, type='l', col='springgreen4', lwd=1.5, lty=5) 549 | 550 | #Legend 551 | #By default its x-position, legendx, is in the middle 552 | legendx=.035 ; 553 | #Move left for p-curves that have more 80% of p-values =.02 or =.03 so that the legend does not touch blue line 554 | if (blue04>.80 | blue05>.80) legendx=.02 555 | #Print legend 556 | legend(legendx, 100, c('Observed p-curve','Null of 33% power', 'Null of zero effect'), 557 | box.col="white",lty=c(1,5,3), cex=.75,lwd=c(1,1),col=c('dodgerblue2','springgreen4', 'firebrick2')); 558 | 559 | #ADD THE POWER FIT CHART 560 | plotfit() 561 | 562 | #PRINT OUT RESULTS 563 | printout=function() 564 | {cat("\nTest for right-skew....Binomial: ",binom.r," Continuous: Z=",Zppr," p=",p.Zppr) 565 | cat("\nTest for 33%....Binomial: ",binom.33," Continuous: Z=",Zpp33," p=",p.Zpp33) 566 | cat("\nTest for left-skew....Binomial: ",binom.l," Continuous: Z=",Zppl," p=",p.Zppl) 567 | } 568 | printout() 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | ################################################ 582 | #15 Cumulative test 583 | #MAKE CUMULATIVE CONDITIONAL ON SIGNIFICNCE SO IF RIGHT-SKEW IS SIGNIFICANT, EXCLUDE LOWEST P-VALUES 584 | #BUT IF RIGHT SKEW IS N.S., EXCLUEDE HIGHEST P-VALUES 585 | #OR MAYBE DO IT BOTH WAYS ALWAYS 586 | 587 | #If right skew is significant, assess robustness to excluding most significnat finding, one at a time 588 | all.zppr = sort(qnorm(c(t.ppr, f.ppr ,c.ppr, z.ppr ))) 589 | all.zppl = sort(qnorm(c(t.ppl, f.ppl ,c.ppl, z.ppl ))) 590 | all.zpp33= sort(qnorm(c(t.pp33,f.pp33 ,c.pp33, z.pp33 ))) 591 | 592 | droplow.zr=droplow.zl=droplow.z33=drophigh.zr=drophigh.zl=drophigh.z33=c() 593 | for (i in 1:(ktot)) 594 | { 595 | droplow.zr[i] =sum(all.zppr[i:ktot]/sqrt(ktot-i+1)) 596 | droplow.zl[i] =sum(all.zppl[i:ktot]/sqrt(ktot-i+1)) 597 | droplow.z33[i]=sum(all.zpp33[i:ktot]/sqrt(ktot-i+1)) 598 | 599 | drophigh.zr[i] =sum(all.zppr[1:(ktot-i+1)]/sqrt(ktot-i+1)) 600 | drophigh.zl[i] =sum(all.zppl[1:(ktot-i+1)]/sqrt(ktot-i+1)) 601 | drophigh.z33[i]=sum(all.zpp33[1:(ktot-i+1)]/sqrt(ktot-i+1)) 602 | } 603 | 604 | 605 | 606 | #19.2 FUNCTION THAT PLOTS RESULTS 607 | plotdrop=function(var) 608 | { 609 | #Plot the dots 610 | plot(0:(ktot-1),pnorm(var),xlab="",ylab="",type="b",yaxt="n",main="",cex.main=1.15,ylim=c(0,1)) 611 | #Add marker in results with 0 drops 612 | points(0,pnorm(var[1]),pch=19,cex=1.6) 613 | #Red line at p=.05 614 | abline(h=.05,col="red") #Red line at p=.05 615 | #Y-axis value labels 616 | axis(2,c(.01,.05,.1,seq(from=.2,to=.9,by=.10)),las=1,cex.axis=.95) 617 | } 618 | 619 | #19.3 RUN PLOT FUNCTION 6 TIMES 620 | #Put all graphs together 621 | dev.off() 622 | par(mfrow=c(3,2),mar=c(4,4,1,2),mgp=c(2.5,1,0),oma=c(5,14,5,1)) 623 | #Plot(1) 624 | plotdrop(droplow.zr) 625 | mtext(side=2,line=4,"P-value Overall Test",font=2,cex=.85) 626 | mtext(side=2,line=3,"(Stouffer's Method)",font=3,cex=.75) 627 | #Rigt Skew label 628 | mtext("Right Skew",line=8,side = 2,cex=1.2,las=1,col="Blue") 629 | #Low to high label 630 | mtext(bquote("Drop"~italic(k)~bold("lowest")~"original p-values"),line=1,side = 3,cex=1.5,las=1) 631 | #Plot(2) 632 | plotdrop(drophigh.zr) 633 | mtext(bquote("Drop"~italic(k)~bold("highest")~"original p-values"),line=1,side = 3,cex=1.5,las=1) 634 | #Plot (3) 635 | plotdrop(drophigh.z33) 636 | mtext(side=2,line=4,"P-value Overall Test",font=2,cex=.85) 637 | mtext(side=2,line=3,"(Stouffer's Method)",font=3,cex=.75) 638 | #33% Skew label 639 | mtext("33% Power%",line=8,side = 2,cex=1.2,las=1,col="springgreen4") 640 | #Plot (4) 641 | plotdrop(droplow.z33) 642 | #Plot (5) 643 | plotdrop(drophigh.zl) 644 | mtext(side=2,line=4,"P-value Overall Test",font=2,cex=.85) 645 | mtext(side=2,line=3,"(Stouffer's Method)",font=3,cex=.75) 646 | mtext(side=1,line=2.5,"K Tests Dropped From p-curve",cex=1.15,font=2) 647 | #33% Skew label 648 | mtext("Left Skew",line=8,side = 2,cex=1.2,las=1,col="red") 649 | #Plot (6) 650 | plotdrop(droplow.zl) 651 | #x-axis label 652 | mtext(side=1,line=2.5,"K Tests Dropped From p-curve",cex=1.15,font=2) 653 | #Legend (winging it for location) 654 | op=par(usr=c(0,1,0,1),xpd=NA) #allow goin outsie of plot 6 and recalibrate dimensions to be 0-1 in x and y 655 | legend(-.6,-.25,horiz=TRUE,pch=c(19,1),cex=1.4, legend=c("Including all p-values","Dropping p-values")) 656 | #so the legend is placed 60% of a chart to the left of 0 of #6, an 25% of a chart below it. 657 | 658 | 659 | 660 | 661 | 662 | -------------------------------------------------------------------------------- /original code from others/VadilloHardwickeShanks_effect_sizes edited.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/original code from others/VadilloHardwickeShanks_effect_sizes edited.xlsx -------------------------------------------------------------------------------- /original code from others/VadilloHardwickeShanks_effect_sizes.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/original code from others/VadilloHardwickeShanks_effect_sizes.xlsx -------------------------------------------------------------------------------- /original code from others/VadilloHardwickeShanks_pcurve_disclosure_table.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/original code from others/VadilloHardwickeShanks_pcurve_disclosure_table.xlsx -------------------------------------------------------------------------------- /original code from others/comparisonMoney.R: -------------------------------------------------------------------------------- 1 | library(rio) 2 | dat <- import("VadilloHardwickeShanks_effect_sizes edited.xlsx") 3 | 4 | 5 | dat$id <- 1:nrow(dat) 6 | 7 | plot(dat[, "d"], dat[, "p-checker d"]) 8 | 9 | # relative error: 10 | dat$relErr <- dat[, "p-checker d"]/dat[, "d"] 11 | 12 | dat[order(dat$relErr), c("Paper title", "# study", "id", "relErr")] 13 | 14 | dat[47, ] -------------------------------------------------------------------------------- /original code from others/input_data.csv: -------------------------------------------------------------------------------- 1 | "","line","paper_id","study_id","focal","type","df1","df2","d","g","n.approx","statistic","p.value","p.value.one","p.reported","p.crit","significant","one.tailed","reporting.error","error.direction","parse.error","d.reported","d.reported.str","d.reported.lower","d.reported.upper","d.reported.error","d.reported.error.direction","global.reporting.error","p.value.log","d.var","d.se","studydesign","Z","obs.pow","median.obs.pow","ppr","ppl","pp33" 2 | "1",1,".1","",TRUE,"r",24,NA,0.29088723694137,1.2755127414112,26,0.55,0.00360407531761852,0.00180203765880926,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.62569004111409,0.229390681003584,0.4789474720714,1,2.91088422817956,0.82917756772308,0.82917756772308,0.0720815063523705,0.927918493647629,0.782466903131448 3 | "2",2,".2","",TRUE,"r",21,NA,0.279751442472094,0.971379778043892,23,0.45,0.0311965812500361,0.0155982906250181,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.46744676548987,0.227985180963237,0.477477937671718,1,2.15455617969051,0.577143893186187,0.577143893186187,0.623931625000722,0.376068374999278,0.217796977829189 4 | "3",3,".3","",TRUE,"t",72,NA,0.509371631973611,1.10462840992093,74,4.8,8.35717690715014e-06,4.17858845357507e-06,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-11.6923898784302,0.0708838568298028,0.266240223914049,1,4.45582350015752,0.993717382306396,0.993717382306396,0.000167143538143399,0.999832856461857,0.99613676861413 5 | "4",4,".4","",TRUE,"f",1,40,0.690065559342354,0.677669172048779,42,5,0.0309924607128595,0.0154962303564298,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.47401130688657,0.106575963718821,0.32645974287624,1,2.15716949070589,0.578166639034966,0.578166639034966,0.619849214257191,0.380150785742809,0.213926089890086 6 | "5",5,".5","",TRUE,"f",1,48,0.772528316633119,0.760882161105986,50,7.46,0.00879913945031573,0.00439956972515787,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.73310135201655,0.091936,0.303209498531956,1,2.61976106247763,0.745307970624029,0.745307970624029,0.175982789006315,0.824017210993685,0.604610782657955 7 | "6",6,".6","",TRUE,"t",131,NA,0.274752109736233,0.432829943657599,133,2.51,0.0132910922918141,0.00664554614590705,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.320661220634,0.0314998247498445,0.17748189978092,1,2.47587279602212,0.697040950212269,0.697040950212269,0.265821845836283,0.734178154163717,0.491182666588346 8 | "7",7,".7","",TRUE,"t",131,NA,0.260132990857236,0.387994969414183,133,2.25,0.0261168387751227,0.0130584193875613,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.64517500888438,0.0312199672112612,0.176691729323308,1,2.22446999974079,0.604304984819912,0.604304984819912,0.522336775502454,0.477663224497546,0.273980322296265 9 | "8",8,".8","",TRUE,"t",29,NA,0.529150262212918,0.760475132484101,31,2.17,0.0383397639770765,0.0191698819885383,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.26126769743271,0.148632258064516,0.38552854377402,1,2.07120370007826,0.544286870697626,0.544286870697626,0.766795279541528,0.233204720458472,0.125039608609917 10 | "9",9,".9","",TRUE,"t",40,NA,0.49856938190329,0.790994082847591,42,2.61,0.0126787848554428,0.00633939242772139,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.36782516615488,0.110685034013605,0.332693603806273,1,2.49266656165906,0.702880259048569,0.702880259048569,0.253575697108857,0.746424302891143,0.515629960683949 11 | "10",10,".10","",TRUE,"t",110,NA,0.466368952654441,1.1431776470224,112,6.09,1.69209997088078e-08,8.46049985440388e-09,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-17.8947104000688,0.0475408482142857,0.21803863926902,1,5.64085277918162,0.999883788818096,0.999883788818096,1e-05,0.99999,0.999961882529907 12 | "11",11,".11","",TRUE,"t",94,NA,0.461880215351701,1.03692933932962,96,5.12,1.61818787419967e-06,8.09093937099835e-07,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-13.3342036309887,0.0530444444444444,0.230313795601663,1,4.79605757533483,0.997716546956351,0.997716546956351,3.23637574872748e-05,0.999967636242513,0.998779821611614 13 | "12",12,".12","",TRUE,"f",1,87,0.414349361358778,0.410847817459971,89,3.82,0.0538557154894872,0.0269278577447436,"",0.05,FALSE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-2.92144674378836,0.0468728695871733,0.216501430912531,1,1.92799526215487,0.487248497031451,0.487248497031451,NA,NA,NA 14 | "13",13,".13","",TRUE,"f",1,68,0.636957051703084,0.630108051147137,70,7.1,0.00961854088426485,0.00480927044213242,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.64406270104072,0.0629387755102041,0.250876016211602,1,2.58924938143763,0.735418885034372,0.735418885034372,0.192370817685297,0.807629182314703,0.579411069007791 15 | "14",14,".14","",TRUE,"f",1,71,0.514448767368118,0.50914517182824,73,4.83,0.0312315030469807,0.0156157515234903,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.46632798053978,0.0584199662225558,0.241702226350019,1,2.15411055431263,0.576969441057547,0.576969441057547,0.624630060939615,0.375369939060385,0.207513129149036 16 | "15",15,".15","",TRUE,"f",1,93,0.51789045783427,0.51379106107041,95,6.37,0.0133022084500757,0.00665110422503787,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.31982520866114,0.0449285318559557,0.211963515388747,1,2.47557428865539,0.696936693930562,0.696936693930562,0.266044169001516,0.733955830998484,0.49343168837509 17 | "16",16,".16","",TRUE,"f",1,94,0.436367582052868,0.432949559216945,96,4.57,0.0351308175301616,0.0175654087650808,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.34867654140781,0.0436501736111111,0.208926239642394,1,2.10684730486995,0.558387941216862,0.558387941216862,0.702616350603231,0.297383649396769,0.158270246095359 18 | "17",17,".17","",TRUE,"f",1,101,0.433544882392289,0.430380321206944,103,4.84,0.0300863104415412,0.0150431552207706,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.50368501328798,0.0406598171363936,0.201642795895102,1,2.16895223479203,0.582771294481587,0.582771294481587,0.601726208830824,0.398273791169176,0.221084518497099 19 | "18",18,".18","",TRUE,"f",1,101,0.409119347839599,0.406133075227631,103,4.31,0.0404286253060717,0.0202143126530358,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.20821719773608,0.0404599868036573,0.201146679822604,1,2.04934260505402,0.53560949309077,0.53560949309077,0.808572506121434,0.191427493878566,0.0976569262926101 20 | "19",19,".19","",TRUE,"f",1,195,0.46480168796709,0.463029889918931,197,10.64,0.00130640632273191,0.000653203161365954,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-6.64047517650657,0.0214012213661779,0.146291562867371,1,3.21456873778193,0.895188861450501,0.895188861450501,0.0261281264546387,0.973871873545361,0.8671599879472 21 | "20",20,".20","",TRUE,"f",1,58,0.724798822662767,0.715700929491268,60,7.88,0.00679646396319998,0.00339823198159999,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.99135280746155,0.0754222222222222,0.274631065653946,1,2.70665601217701,0.772375258398578,0.772375258398578,0.135929279264,0.864070720736,0.657123186618878 22 | "21",21,".21","",TRUE,"f",1,164,0.296972677336379,0.295628909565627,166,3.66,0.0574760040131121,0.028738002006556,"",0.05,FALSE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-2.85638773979278,0.0246276672956888,0.156932046745363,1,1.89967331752034,0.475962067532297,0.475962067532297,NA,NA,NA 23 | "22",22,".22","",TRUE,"f",1,106,0.481509970667121,0.478158393145076,108,6.26,0.0138776711900495,0.00693883559502474,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.27747411967712,0.0391838134430727,0.197949017282412,1,2.46041429863165,0.691620983399602,0.691620983399602,0.277553423800989,0.722446576199011,0.48075567089181 24 | "23",23,".23","",TRUE,"f",1,148,0.570847323429537,0.56798832180969,150,12.22,0.000624218847119088,0.000312109423559544,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-7.37900953454452,0.0288391111111111,0.169820820605458,1,3.42086685229699,0.927978950242731,0.927978950242731,0.012484376942381,0.987515623057619,0.917176335624655 25 | "24",24,".24","",TRUE,"f",1,144,0.342032602787897,0.340272572241818,146,4.27,0.0405824480926305,0.0202912240463153,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.20441961883805,0.0281985363107525,0.167924198109601,1,2.04777094977314,0.534984949152145,0.534984949152145,0.811648961852611,0.188351038147389,0.0955611797867638 26 | "25",25,".25","",TRUE,"f",1,57,0.557232872842469,0.550119261699799,59,4.58,0.0366399054451497,0.0183199527225749,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.30661731982501,0.0730594656707843,0.27029514548135,1,2.08975397783224,0.551633709929254,0.551633709929254,0.732798108902994,0.267201891097006,0.141913104513516 27 | "26",26,".26","",TRUE,"f",1,74,0.5419263884757,0.53656078066901,76,5.58,0.0207981732110946,0.0103990866055473,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.87289012252151,0.0564958448753463,0.237688545948992,1,2.31162834511492,0.637455004258161,0.637455004258161,0.415963464221893,0.584036535778107,0.357805981814757 28 | "27",27,".27","",TRUE,"f",1,114,0.50137741307804,0.498128747334554,116,7.29,0.00799037289180683,0.00399518644590341,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.82951785047984,0.0366498216409037,0.191441431359316,1,2.65247633493292,0.755692183679693,0.755692183679693,0.159807457836136,0.840192542163864,0.61702764545556 29 | "28",28,".28","",TRUE,"f",1,52,0.592546294487706,0.584278206657645,54,4.74,0.0340305629599248,0.0170152814799624,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.38049624755812,0.0805761316872428,0.28385935194607,1,2.11970936239737,0.563459173243494,0.563459173243494,0.680611259198498,0.319388740801502,0.173682546013417 30 | "29",29,".29","",TRUE,"f",1,177,0.46365080291002,0.461705414925782,179,9.62,0.00224038070549626,0.00112019035274813,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-6.10110946974555,0.0235473299834587,0.153451392901657,1,3.05636536542108,0.863548420032635,0.863548420032635,0.0448076141099252,0.955192385890075,0.815997368233336 31 | "30",30,".30","",TRUE,"f",1,98,0.435889894354067,0.432612526727345,100,4.75,0.0316941780811593,0.0158470890405797,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.45162227171163,0.0419,0.204694894904587,1,2.14824650515707,0.574672406582344,0.574672406582344,0.633883561623185,0.366116438376815,0.200447965782009 32 | "31",31,".31","",TRUE,"f",1,102,0.591932948385723,0.587653915023899,104,9.11,0.0032110006079154,0.0016055003039577,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.74117267455201,0.0418306213017751,0.204525356134087,1,2.94678144777489,0.838133933958407,0.838133933958407,0.064220012158307,0.935779987841693,0.775208294097308 33 | "32",32,".32","",TRUE,"f",1,210,0.289110542285087,0.288086538003086,212,4.43,0.0365016516870469,0.0182508258435234,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.3103977677176,0.0192621929512282,0.138788302645533,1,2.09129473290601,0.552243165619191,0.552243165619191,0.730033033740938,0.269966966259062,0.140880705340051 34 | "33",33,".33","",TRUE,"f",1,166,0.396112057257491,0.394341064453061,168,6.59,0.0111378993754398,0.00556894968771991,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-4.49740162820277,0.0247434807256236,0.157300606246841,1,2.53834227860733,0.718495627385032,0.718495627385032,0.222757987508797,0.777242012491203,0.537204665768733 35 | "34",34,".34","",TRUE,"f",1,105,0.565024191029551,0.561054466034027,107,8.54,0.00425487784276655,0.00212743892138328,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.45968922647196,0.0403668442658748,0.200915017522023,1,2.85862026791273,0.815582115302661,0.815582115302661,0.0850975568553314,0.914902443144669,0.734133155930902 36 | "35",35,".35","",TRUE,"f",1,136,0.341777111876876,0.339916256458309,138,4.03,0.0466794181908717,0.0233397090954358,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.06445193541884,0.029831968073934,0.17271933323729,1,1.98919740541028,0.511660786691341,0.511660786691341,0.933588363817432,0.0664116361825675,0.0322880907323393 37 | "36",36,".36","",TRUE,"f",1,40,0.672592709134549,0.660510205377641,42,4.75,0.0352452734776854,0.0176226367388427,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-3.34542384445358,0.106009070294785,0.325590341218508,1,2.10552914035412,0.55786766171974,0.55786766171974,0.704905469553707,0.295094530446293,0.16020561030283 38 | "37",37,".37","",TRUE,"f",1,33,1.00740118267607,0.985658711107521,35,8.88,0.00537703944999096,0.00268851972499548,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.22561734437828,0.143281632653061,0.378525603695524,1,2.78353298645071,0.794907752419558,0.794907752419558,0.10754078899982,0.89245921100018,0.711103035779388 39 | "38",38,".38","",TRUE,"f",1,87,0.670066238550297,0.664403706956914,89,9.99,0.00216609583598695,0.00108304791799348,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-6.13482888577413,0.0499886377982578,0.223581389650968,1,3.06646028266952,0.865744117290527,0.865744117290527,0.0433219167197407,0.956678083280259,0.824033629578809 40 | "39",39,".39","",TRUE,"f",1,38,0.924121204171834,0.906684955036516,40,8.54,0.00582192175893804,0.00291096087946902,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.14612487261228,0.12135,0.348353268967007,1,2.75764594685673,0.787472463058218,0.787472463058218,0.116438435178761,0.883561564821239,0.693749551672917 41 | "40",40,".40","",TRUE,"f",1,64,0.722369837284325,0.714129877163211,66,8.61,0.00463695846776365,0.00231847923388182,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-5.3736966303169,0.0685123966942149,0.261748728161599,1,2.83122847836673,0.808195123717305,0.808195123717305,0.0927391693552737,0.907260830644726,0.725150196897885 42 | "41",41,".41","",TRUE,"t",112,NA,0.262244027242874,0.364720924042398,114,1.96,0.0524797674224698,0.0262398837112349,"",0.05,FALSE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-2.9473275660926,0.0362701138811942,0.190447141961212,1,1.93917717912819,0.491707861611144,0.491707861611144,NA,NA,NA 43 | "42",42,".42","",TRUE,"t",119,NA,0.336240763798308,0.617955957086392,121,3.42,0.000858512387186752,0.000429256193593376,"",0.05,TRUE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-7.06030944885868,0.0362533706714022,0.190403179257601,1,3.33320636606345,0.915161495880609,0.915161495880609,0.0171702477437341,0.982829752256266,0.899501014219001 44 | "43",43,".43","",TRUE,"t",44,NA,0.40108548367822,0.536592037153888,46,1.85,0.0710363047415143,0.0355181523707572,"",0.05,FALSE,FALSE,NA,"",FALSE,NA,"",NA,NA,NA,"",FALSE,-2.64456419824018,0.0934262759924386,0.3056571216125,1,1.8052453022587,0.438521550508933,0.438521550508933,NA,NA,NA 45 | -------------------------------------------------------------------------------- /original code from others/oldParser.R: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # Parser for the ES strings 3 | # - parse test statistics and dfs 4 | # - compute correct p value 5 | # - convert all to ES to Z values 6 | # @param x A string with the effect size. Everything before the colon is an identifier for the paper (can be a number, or the name of the paper). Test statistics with the same identifier belong together. You can also skip that part. By default a critical two-tailed p value of .05 is assumed; to override this for a certain test statistic, write at the end of the line: '; crit = .10', for example. Examples: 7 | 8 | # x = "MMu (2012) S1: t(88)=2.1; crit = .10; p < .04 # comment" 9 | # x = "1: t(88)=2.1, crit = .10, p < .04 # comment" 10 | # x = "1: t(88)=2.1; p < .04; crit = .10" 11 | # x = "Stapel (2008): r(147)=.246" 12 | # x = "F(1,100)=9.1" 13 | # x = "F(2,210)=4.45" 14 | # x = "Z=3.45" 15 | # x = "chi2(1)=9.1" 16 | # x = "r(77)=.47" 17 | 18 | 19 | 20 | # @param round_up: If the t value is reported as 2.1, it could also be 2.1499 which has been rounded down. If you want to be maximally generous, set this parameter to TRUE, and all test statistics are automatically increased by X.XX49. 21 | parse_ES1 <- function(x, paper_id_fallback="_1", round_up=FALSE) { 22 | 23 | library(compute.es) 24 | 25 | W <- c() # W collects all warnings 26 | 27 | # preprocessing: replace typographic characters 28 | x <- gsub("–|−", "-", x) 29 | 30 | # remove everything after a # sign; remove empty rows; convert to lower 31 | x <- gsub("#.*$", "", x) 32 | x <- str_trim(x) 33 | 34 | # replace all commas outside of parentheses with semicolons 35 | if (str_detect(x, "\\)")==TRUE) { 36 | x1 <- str_match(x, "(.*)\\)(.*)")[2] 37 | x2 <- str_match(x, "(.*)\\)(.*)")[3] 38 | x2 <- gsub(",", ";", x2) 39 | x <- paste0(x1, ")", x2) 40 | } 41 | 42 | # Is it only a comment line? Return NULL 43 | if (x == "") return(NULL) 44 | 45 | split0 <- strsplit(x, ":")[[1]] 46 | 47 | # Is a study id provided? 48 | if (length(split0) > 1) { 49 | # separate study id into two parts: 50 | # a) First part until year of publication; b) everything after that 51 | paper_id_full <- as.character(gsub(":", "", split0[1])) 52 | paper_id <- str_match(paper_id_full, "^.*\\(.*\\)")[1] 53 | if (is.na(paper_id)) { 54 | paper_id <- paper_id_full 55 | study_id <- "" 56 | } else { 57 | study_id <- str_trim(str_match(paper_id_full, "\\(.*\\)(.*$)")[2]) 58 | } 59 | x2 <- split0[2] 60 | } else { 61 | paper_id <- paper_id_fallback 62 | study_id <- "" 63 | x2 <- split0[1] 64 | } 65 | 66 | split1 <- strsplit(gsub(" ", "", x2), ";")[[1]] 67 | 68 | # define defaults 69 | p.crit <- NA 70 | p.reported <- NA 71 | reporting.error <- NA 72 | error.direction <- "" 73 | one.tailed <- FALSE 74 | 75 | # Is a critical p value and/or reported p value provided? Is it one-tailed? 76 | if (length(split1) > 1) { 77 | for (i in 2:length(split1)) { 78 | 79 | split1[i] <- tolower(split1[i]) 80 | 81 | if (str_detect(split1[i], "crit") == TRUE) { 82 | x3 <- strsplit(gsub(" ", "", split1[i]), "=|<|>")[[1]] 83 | p.crit <- suppressWarnings(as.numeric(as.character(x3[2]))) 84 | } 85 | 86 | if (str_detect(split1[i], "p\\s*(=|<|>)")==TRUE) { 87 | p.reported <- gsub(" ", "", split1[i]) 88 | } 89 | 90 | if (str_detect(split1[i], "one|1t|one-tailed") == TRUE) { 91 | one.tailed <- TRUE 92 | } 93 | } 94 | } 95 | 96 | # set default for p.crit if not defined explicitly 97 | if (is.na(p.crit)) { 98 | p.crit <- ifelse(one.tailed==FALSE, .05, .10) 99 | } 100 | 101 | split2 <- strsplit(split1[1], "=")[[1]] 102 | lhs <- split2[1] 103 | statistic <- suppressWarnings(as.numeric(split2[2])) 104 | 105 | decPlaces <- decplaces(str_trim(split2[2])) 106 | 107 | if (round_up==TRUE) { 108 | statistic <- statistic + sign(statistic)* (4.999 / 10^(decPlaces+1)) 109 | } 110 | 111 | # also convert brackets to parentheses 112 | lhs <- gsub("[", "(", lhs, fixed=TRUE) 113 | lhs <- gsub("]", ")", lhs, fixed=TRUE) 114 | 115 | type <- tolower(strsplit(lhs, "(", fixed=TRUE)[[1]][1]) 116 | dfs <- str_extract(lhs, "\\(.*\\)") 117 | dfs <- suppressWarnings(as.numeric(strsplit(substring(dfs, 2, nchar(dfs)-1), ",")[[1]])) # remove parentheses 118 | 119 | # error capturing 120 | if (!type %in% c("t", "f", "r", "z", "chi2")) { 121 | W <- c(W, paste0("Test statistic not recognized! ", x)) 122 | return(W) 123 | } 124 | if (type != "z" && is.na(as.numeric(dfs[1]))) { 125 | W <- c(W, paste0("Error in df: ", x)) 126 | return(W) 127 | } 128 | if (is.na(as.numeric(statistic))) { 129 | W <- c(W, paste0("Error in test statistic: ", x)) 130 | return(W) 131 | } 132 | 133 | # compute the actual p values 134 | p.value <- NA 135 | stat <- abs(statistic) 136 | stat.sign <- sign(statistic) 137 | n.approx <- NA # n is approximate because we do not know whether the t-test comes from one sample (n = df+1) or from two samples (n=df+2) 138 | switch(type, 139 | "t" = { 140 | if (length(dfs) != 1) { 141 | W <- c(W, paste0("t values need exactly one df! ", x)) 142 | return(W) 143 | } 144 | t.value <- stat 145 | p.value <- pt(t.value, dfs, lower.tail=FALSE)*2 146 | d <- (2*t.value / sqrt(dfs))*stat.sign 147 | g <- d*(1 - (3/(4 * dfs - 1))) 148 | n.approx <- dfs+2 149 | }, 150 | "r" = { 151 | if (length(dfs) != 1) { 152 | W <- c(W, paste0("r values need exactly one df (df = n-2)! ", x)) 153 | return(W) 154 | } 155 | t.value <- sqrt(dfs) * stat/sqrt(1 - stat^2) 156 | p.value <- pt(t.value, dfs, lower.tail=FALSE)*2 157 | d <- stat.sign*(2*stat) / sqrt(1-stat^2) 158 | g <- d*(1 - (3/(4 * dfs - 1))) 159 | n.approx <- dfs+2 160 | }, 161 | "f" = { 162 | if (length(dfs) != 2) { 163 | W <- c(W, paste0("F values need exactly two dfs! ", x)) 164 | return(W) 165 | } 166 | #if (dfs[1] != 1) warning("First df of F test should be 1 for a focused test!") 167 | if (dfs[1] == 1) { 168 | t.value <- sqrt(stat) 169 | d <- 2*t.value / sqrt(dfs[2]) 170 | g <- d*(1 - (3/(4 * dfs[2] - 1))) 171 | n.approx <- dfs[2]+2 172 | } else { 173 | d <- NA 174 | g <- NA 175 | } 176 | p.value <- pf(stat, dfs[1], dfs[2], lower.tail=FALSE) 177 | }, 178 | "z" = { 179 | p.value <- pnorm(stat, lower.tail=FALSE)*2 180 | 181 | # If a number is provided for z it's the sample size 182 | if (!is.na(dfs[1])) { 183 | n <- dfs[1] 184 | d <- (z/sqrt(n))*stat.sign 185 | g <- d*(1 - (3/(4 * n - 1))) 186 | n.approx <- n 187 | } else { 188 | d <- NA 189 | g <- NA 190 | } 191 | }, 192 | "chi2" = { 193 | # If two numbers are provided for chi2, the first are the dfs, the second is the sample size 194 | p.value <- pchisq(stat, dfs[1], lower.tail=FALSE) 195 | 196 | if (dfs[1] == 1 & !is.na(dfs[2])) { 197 | # code from compute.es package 198 | n <- dfs[2] 199 | n.approx <- n 200 | dfs <- dfs[1] 201 | r <- sqrt(stat/n) 202 | d <- 2 * r * sqrt((n - 1)/(n * (1 - r^2))) * abs(r)/r 203 | g <- d*(1 - (3/(4 * (n-2) - 1))) 204 | } else { 205 | d <- NA 206 | g <- NA 207 | } 208 | } 209 | ) 210 | 211 | # test for reporting errors 212 | # TODO: check both generous *and* non-generous - maybe one of both is correct 213 | # Or better: computer upper and lower bound of p-value: t(47)=2.1 --> from 2.05 to 2.1499 214 | # and check whether the reported p value falls into the interval 215 | 216 | p.actual <- ifelse(one.tailed==FALSE, p.value, p.value/2) 217 | p.reported.num <- suppressWarnings(as.numeric(str_split(p.reported, "=|<|>|<=|>=")[[1]][2])) 218 | 219 | if (!is.na(p.reported) & !is.na(p.reported.num)) { 220 | # check for inequality 221 | if (str_detect(p.reported, "<")) { 222 | if (p.actual >= p.reported.num) { 223 | reporting.error <- TRUE 224 | error.direction <- "smaller" 225 | } else { 226 | reporting.error <- FALSE 227 | error.direction <- "" 228 | } 229 | } 230 | 231 | if (str_detect(p.reported, "<=")) { 232 | if (p.actual >= p.reported.num) { 233 | reporting.error <- TRUE 234 | error.direction <- "smaller" 235 | } else { 236 | reporting.error <- FALSE 237 | error.direction <- "" 238 | } 239 | } 240 | 241 | if (str_detect(p.reported, ">")) { 242 | if (p.actual <= p.reported.num) { 243 | reporting.error <- TRUE 244 | error.direction <- "larger" 245 | } else { 246 | reporting.error <- FALSE 247 | error.direction <- "" 248 | } 249 | } 250 | 251 | if (str_detect(p.reported, "p=")) { 252 | 253 | dec <- decplaces(str_split(p.reported, "=")[[1]][2]) 254 | p.actual <- round(p.actual, dec) 255 | 256 | if (p.reported.num == p.actual) { 257 | reporting.error <- FALSE 258 | error.direction <- "" 259 | } else { 260 | reporting.error <- TRUE 261 | error.direction <- ifelse(p.reported.num > p.actual, "larger", "smaller") 262 | } 263 | } 264 | 265 | } 266 | 267 | res <- data.frame( 268 | paper_id = as.character(paper_id), 269 | study_id = as.character(study_id), 270 | focal = ifelse(substr(as.character(paper_id), 1, 1) == "_", FALSE, TRUE), 271 | type = type, 272 | df1 = dfs[1], 273 | df2 = ifelse(length(dfs)>1, dfs[2], NA), 274 | d = d, 275 | g = g, 276 | n.approx = n.approx, 277 | statistic = statistic, 278 | p.value = p.value, 279 | p.value.one = p.value/2, 280 | p.reported = p.reported, 281 | p.crit = p.crit, 282 | significant = p.value < p.crit, 283 | one.tailed = one.tailed, 284 | reporting.error = reporting.error, 285 | error.direction = error.direction 286 | ) 287 | 288 | attr(res, "warnings") <- W 289 | 290 | return(res) 291 | } 292 | 293 | 294 | 295 | # A vectorized version of the parse_ES1 function 296 | parse_ES <- function(x, round_up=FALSE) { 297 | 298 | # split input string at line break & remove empty rows 299 | # Preprocessing: remove everything after a # sign; remove empty rows 300 | txt <- str_trim(strsplit(x, "\n")[[1]]) 301 | txt <- gsub("#.*$", "", txt) 302 | txt <- str_trim(txt) 303 | txt <- txt[txt != ""] 304 | 305 | if (txt[1]=="" | length(txt)==0) return(NULL) 306 | 307 | res <- data.frame() 308 | Ws <- c() 309 | for (i in 1:length(txt)) { 310 | parsed <- parse_ES1(txt[i], paper_id_fallback = paste0(".", i), round_up=round_up) 311 | if (!is.null(parsed) & is.data.frame(parsed)) res <- rbind(res, parsed) 312 | 313 | # collect errors 314 | if (length(attr(parsed, "warnings")) > 0) Ws <- c(Ws, attr(parsed, "warnings")) 315 | if (is.character(parsed)) Ws <- c(Ws, parsed) 316 | } 317 | 318 | if (nrow(res) == 0) return(NULL) 319 | res2 <- cbind(ID <- 1:nrow(res), res) 320 | 321 | attr(res2, "warnings") <- Ws 322 | return(res2) 323 | } 324 | 325 | 326 | 327 | -------------------------------------------------------------------------------- /original code from others/old_p_curve_get33.R: -------------------------------------------------------------------------------- 1 | get_33_curve <- function(type, statistic, df, df2, p.crit=.05, power=1/3) { 2 | 3 | # convert r to t values 4 | type <- as.character(type) 5 | statistic[tolower(type)=="r"] <- statistic[tolower(type)=="r"] / sqrt( (1 - statistic[tolower(type)=="r"]^2) / df[tolower(type)=="r"]) 6 | type[tolower(type)=="r"] <- "t" 7 | 8 | statistic <- abs(statistic) 9 | 10 | type <- c("f", "f", "f", "t", "r") 11 | statistic <- c(5.1, 6.3, 7.1, 2.3, 0.4) 12 | df <- c(1, 1, 1, 38, 98) 13 | df2 <- c(88, 100, 200, 38, 98) 14 | 15 | ncp <- get_pp_values(type=type, statistic=statistic, df=df, df2=df2, p.crit=.05, power=1/3)$ncp 16 | 17 | res <- data.frame() 18 | 19 | # --------------------------------------------------------------------- 20 | # t-values 21 | # Critical values,xc, for p=.05, .04, .03, .02 and ,01 22 | t.crit <- list() 23 | t.CRIT <- c(.975, .98, .985, .99, .995) 24 | for (j in 1:5) 25 | t.crit[[j]] <- qt(t.CRIT[j], df=df[type=="t"]) 26 | 27 | # Probability of a p-value bigger p=.05, .04, .03, .02 and .01 given p<.05 and ncp=ncp33 28 | t.pp <- c() 29 | for (j in 1:5) 30 | t.pp[j] <- mean((1/power)*(pt(t.crit[[j]], df=df[type=="t"], ncp=ncp[ncp$type=="t", "ncp"])-(1-power))) 31 | 32 | t.pp[1] <- 0 33 | t.pp <- c(t.pp, 1) 34 | t.prop <- t.pp[2:6]-t.pp[1:5] 35 | 36 | # --------------------------------------------------------------------- 37 | # F-values 38 | # Critical values,xc, for p=.05, .04, .03, .02 and ,01 39 | f.crit <- list() 40 | f.CRIT <- c(.95, .96, .97, .98, .99) 41 | for (j in 1:5) 42 | f.crit[[j]] <- qf(f.CRIT[j], df1=df[type=="f"], df2=df2[type=="f"]) 43 | 44 | # Probability of a p-value bigger p=.05, .04, .03, .02 and .01 given p<.05 and ncp=ncp33 45 | f.pp <- c() 46 | for (j in 1:5) 47 | f.pp[j] <- mean((1/power)*(pf(f.crit[[j]], df1=df[type=="f"], df2=df2[type=="f"], ncp=ncp[ncp$type=="f", "ncp"])-(1-power))) 48 | 49 | f.pp[1] <- 0 50 | f.pp <- c(f.pp, 1) 51 | f.prop <- f.pp[2:6]-f.pp[1:5] 52 | 53 | # --------------------------------------------------------------------- 54 | # chi2-values 55 | # Critical values,xc, for p=.05, .04, .03, .02 and ,01 56 | chi.crit <- list() 57 | chi.CRIT <- c(.95, .96, .97, .98, .99) 58 | for (j in 1:5) 59 | chi.crit[[j]] <- qt(chi.CRIT[j], df=df[type=="chi2"]) 60 | 61 | # Probability of a p-value bigger p=.05, .04, .03, .02 and .01 given p<.05 and ncp=ncp33 62 | chi.pp <- c() 63 | for (j in 1:5) 64 | chi.pp[j] <- mean((1/power)*(pchisq(chi.crit[[j]], df=df[type=="chi2"], ncp=ncp[ncp$type=="chi2", "ncp"])-(1-power))) 65 | 66 | chi.pp[1] <- 0 67 | chi.pp <- c(chi.pp, 1) 68 | chi.prop <- chi.pp[2:6]-chi.pp[1:5] 69 | 70 | #TODO: z-values! 71 | } 72 | -------------------------------------------------------------------------------- /original code from others/p-curve disclosure table.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/original code from others/p-curve disclosure table.xlsx -------------------------------------------------------------------------------- /p-checker.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /p-curve.R: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # These p-curve functions are partially copied, partially adapted from Uri Simonsohn's (uws@wharton.upenn.edu) original p-curve functions 3 | # http://p-curve.com/Supplement/Rcode_other/R%20Code%20behind%20p-curve%20app%203.0%20-%20distributable.R 4 | 5 | 6 | # --------------------------------------------------------------------- 7 | # p-curve-app 3.0 functions 8 | 9 | # functions that find noncentrality parameter for t,f,chi distributions that gives 33% power for those d.f. 10 | 11 | #t-test 12 | ncp33t <- function(df, power=1/3, p.crit=.05) { 13 | xc = qt(p=1-p.crit/2, df=df) 14 | #Find noncentrality parameter (ncp) that leads 33% power to obtain xc 15 | f = function(delta, pr, x, df) pt(x, df = df, ncp = delta) - (1-power) 16 | out = uniroot(f, c(0, 37.62), x = xc, df = df) 17 | return(out$root) 18 | } 19 | 20 | 21 | ncp33z <- function(power=1/3, p.crit=.05) { 22 | xc = qnorm(p=1-p.crit/2) 23 | #Find noncentrality parameter (ncp) that leads 33% power to obtain xc 24 | f = function(delta, pr, x) pnorm(x, mean = delta) - (1-power) 25 | out = uniroot(f, c(0, 37.62), x = xc) 26 | return(out$root) 27 | } 28 | 29 | 30 | #F-test 31 | ncp33f <- function(df1, df2, power=1/3, p.crit=.05) { 32 | xc=qf(p=1-p.crit,df1=df1,df2=df2) 33 | f = function(delta, pr, x, df1,df2) pf(x, df1 = df1, df2=df2, ncp = delta) - (1-power) 34 | out = uniroot(f, c(0, 37.62), x = xc, df1=df1, df2=df2) 35 | return(out$root) 36 | } 37 | 38 | #chi-square 39 | ncp33chi <- function(df, power=1/3, p.crit=.05) { 40 | xc=qchisq(p=1-p.crit, df=df) 41 | #Find noncentrality parameter (ncp) that leads 33% power to obtain xc 42 | f = function(delta, pr, x, df) pchisq(x, df = df, ncp = delta) - (1-power) 43 | out = uniroot(f, c(0, 37.62), x = xc, df = df) 44 | return(out$root) 45 | } 46 | 47 | 48 | type=c("t", "p") 49 | statistic=c(2.5, 0.01588969) 50 | df=c(48, NA) 51 | df2=c(NA, NA) 52 | 53 | 54 | get_pp_values <- function(type, statistic, df, df2, p.crit=.05, power=1/3) { 55 | 56 | # convert r to t values 57 | type <- as.character(type) 58 | statistic[tolower(type)=="r"] <- statistic[tolower(type)=="r"] / sqrt( (1 - statistic[tolower(type)=="r"]^2) / df[tolower(type)=="r"]) 59 | type[tolower(type)=="r"] <- "t" 60 | 61 | statistic <- abs(statistic) 62 | 63 | res <- data.frame() 64 | ncp <- data.frame() 65 | for (i in 1:length(type)) { 66 | switch(tolower(type[i]), 67 | "t" = { 68 | p <- 2*(1-pt(abs(statistic[i]),df=df[i])) 69 | ppr <- p*(1/p.crit) # pp-value for right-skew 70 | ppl <- 1-ppr # pp-value for left-skew 71 | ncp33 <- ncp33t(df[i], power=power, p.crit=p.crit) 72 | pp33 <- (pt(statistic[i], df=df[i], ncp=ncp33)-(1-power))*(1/power) 73 | }, 74 | "f" = { 75 | p <- 1-pf(abs(statistic[i]), df1=df[i], df2=df2[i]) 76 | ppr <- p*(1/p.crit) # pp-value for right-skew 77 | ppl <- 1-ppr # pp-value for left-skew 78 | ncp33 <- ncp33f(df1=df[i], df2=df2[i], power=power, p.crit=p.crit) 79 | pp33 <- (pf(statistic[i], df1=df[i], df2=df2[i], ncp=ncp33)-(1-power))*(1/power) 80 | }, 81 | "z" = { 82 | p <- 2*(1-pnorm(abs(statistic[i]))) 83 | ppr <- p*(1/p.crit) # pp-value for right-skew 84 | ppl <- 1-ppr # pp-value for left-skew 85 | 86 | ncp33 <- ncp33z(power=power, p.crit=p.crit) 87 | pp33 <- (pnorm(statistic[i], mean=ncp33, sd=1)-(1-power))*(1/power) 88 | }, 89 | "p" = { 90 | p <- statistic[i] 91 | z <- qnorm(p/2, lower.tail=FALSE) 92 | ppr <- p*(1/p.crit) # pp-value for right-skew 93 | ppl <- 1-ppr # pp-value for left-skew 94 | 95 | ncp33 <- ncp33z(power=power, p.crit=p.crit) 96 | pp33 <- (pnorm(z, mean=ncp33, sd=1)-(1-power))*(1/power) 97 | }, 98 | "chi2" = { 99 | p <- 1-pchisq(abs(statistic[i]), df=df[i]) 100 | ppr <- p*(1/p.crit) # pp-value for right-skew 101 | ppl <- 1-ppr # pp-value for left-skew 102 | ncp33 <- ncp33chi(df[i], power=power, p.crit=p.crit) 103 | pp33 <- (pchisq(statistic[i], df=df[i], ncp=ncp33)-(1-power))*(1/power) 104 | }, 105 | { 106 | # default 107 | warning(paste0("Test statistic ", type[i], " not suported by p-curve.")) 108 | } 109 | ) 110 | res <- rbind(res, data.frame(p=p, ppr=ppr, ppl=ppl, pp33=pp33)) 111 | ncp <- rbind(ncp, data.frame(type=type[i], df=df[i], df2=df2[i], ncp=ncp33)) 112 | } 113 | 114 | if (nrow(res) > 0) { 115 | # clamp to extreme values 116 | res$ppr <- clamp(res$ppr, MIN=.00001, MAX=.99999) 117 | res$ppl <- clamp(res$ppl, MIN=.00001, MAX=.99999) 118 | res$pp33 <- clamp(res$pp33, MIN=.00001, MAX=.99999) 119 | 120 | # remove non-significant values 121 | res[res$p > p.crit, ] <- NA 122 | 123 | return(list(res=res, ncp=ncp)) 124 | } else { 125 | return(NULL) 126 | } 127 | } 128 | 129 | 130 | 131 | 132 | 133 | # --------------------------------------------------------------------- 134 | # New p-curve computation (p-curve app 3.0, http://www.p-curve.com/app3/) 135 | p_curve_3 <- function(pps) { 136 | 137 | pps <- na.omit(pps) 138 | 139 | # STOUFFER: Overall tests aggregating pp-values 140 | ktot <- sum(!is.na(pps$ppr)) 141 | Z_ppr <- sum(qnorm(pps$ppr))/sqrt(ktot) # right skew 142 | Z_ppl <- sum(qnorm(pps$ppl))/sqrt(ktot) # left skew 143 | Z_pp33<- sum(qnorm(pps$pp33))/sqrt(ktot) # 33% 144 | 145 | p_ppr <- pnorm(Z_ppr) 146 | p_ppl <- pnorm(Z_ppl) 147 | p_pp33<- pnorm(Z_pp33) 148 | 149 | return(list( 150 | Z_evidence = Z_ppr, 151 | p_evidence = p_ppr, 152 | Z_hack = Z_ppl, 153 | p_hack = p_ppl, 154 | Z_lack = Z_pp33, 155 | p_lack = p_pp33, 156 | inconclusive = ifelse(p_ppr>.05 & p_ppl>.05 & p_pp33>.05, TRUE, FALSE))) 157 | } 158 | 159 | 160 | # --------------------------------------------------------------------- 161 | # Old p-curve computation (p-curve app 2.0, http://www.p-curve.com/app2/) 162 | p_curve_2 <- function(pps) { 163 | 164 | pps <- na.omit(pps) 165 | 166 | df <- 2*sum(nrow(pps)) 167 | 168 | chi2_evidence <- -2*sum(log(pps$ppr), na.rm=TRUE) 169 | p_evidence <- pchisq(chi2_evidence, df=df, lower.tail=FALSE) 170 | 171 | chi2_hack <- -2*sum(log(pps$ppl), na.rm=TRUE) 172 | p_hack <- pchisq(chi2_hack, df=df, lower.tail=FALSE) 173 | 174 | chi2_lack <- -2*sum(log(pps$pp33), na.rm=TRUE) 175 | p_lack <- pchisq(chi2_lack, df=df, lower.tail=FALSE) 176 | 177 | return(list( 178 | chi2_evidence = chi2_evidence, 179 | p_evidence = p_evidence, 180 | chi2_hack = chi2_hack, 181 | p_hack = p_hack, 182 | chi2_lack = chi2_lack, 183 | p_lack = p_lack, 184 | df = df, 185 | inconclusive = ifelse(p_evidence>.05 & p_hack>.05 & p_lack>.05, TRUE, FALSE))) 186 | } 187 | 188 | 189 | 190 | theoretical_power_curve <- function(power=1/3, p.max=.05, normalize=TRUE) { 191 | # compute arbitrary test statistics for requested power 192 | library(pwr) 193 | d <- 0.2 194 | n <- pwr.t.test(d=0.2, power=power)$n*2 195 | 196 | crit <- seq(0.01, p.max, by=.01) 197 | pdens <- c() 198 | for (cr in crit) { 199 | pdens <- c(pdens, pwr.t.test(d=0.2, power=NULL, n=n/2, sig.level=cr)$power) 200 | } 201 | p.dens <- diff(c(0, pdens)) 202 | if (normalize == TRUE) p.dens <- p.dens/sum(p.dens) 203 | 204 | names(p.dens) <- as.character(crit) 205 | return(p.dens) 206 | } -------------------------------------------------------------------------------- /pancollapse.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(xtable) 3 | library(htmltools) 4 | library(utils) 5 | 6 | pancollapse <- function(){ 7 | tags$head(tags$link(rel="stylesheet", type="text/css", href="pancollapse.css"), 8 | tags$script(src="pancollapse.js")) 9 | } 10 | 11 | alert.create <- function(content, style="info") { 12 | HTML(paste0('' 16 | ) 17 | } 18 | 19 | pancollapse.create <- function(title, content, class="panel-default"){ 20 | HTML('

', 21 | title, 22 | '

', 23 | content, 24 | '
' 25 | ) 26 | } 27 | 28 | panel.create <- function(title, content) { 29 | HTML('

', 30 | title, 31 | '

', 32 | content, 33 | '
' 34 | ) 35 | } 36 | 37 | getTable <- function(df, cbGetClass = NULL) { 38 | thead <- paste0('', htmlEscape(names(df)), '', collapse='') 39 | 40 | tbody <- rep("",nrow(df)) 41 | 42 | for(row in 1:nrow(df)) { 43 | format <- '%s' 44 | 45 | tbody[row] <- paste0(sapply(df[row,], function(x){ sprintf('%s', htmlEscape(as.character(x))) }), collapse=''); 46 | 47 | cls <- NULL 48 | if( is.function(cbGetClass) ) { 49 | cls <- cbGetClass(df[row,]) 50 | } 51 | 52 | if(is.character(cls)) { 53 | tbody[row] <- sprintf('%s', htmlEscape(cls), tbody[row]) 54 | } else { 55 | tbody[row] <- sprintf('%s', tbody[row]) 56 | } 57 | } 58 | 59 | tbody2 <- paste0(tbody, collapse='') 60 | 61 | HTML( 62 | '
', 63 | thead, 64 | '', 65 | tbody2, 66 | '
' 67 | ) 68 | } 69 | 70 | classWhenValueFun <- function(col.name, value, cls) { 71 | return(function(named.row){ 72 | tmp <- named.row[[col.name]] 73 | if(!is.null(tmp) && !is.na(tmp) && tmp == value) cls 74 | }) 75 | } 76 | 77 | readFile <- function(filename) { 78 | fileConnection <- file(filename, encoding="UTF-8") 79 | text <- readChar(fileConnection, file.info(filename)$size, useBytes = TRUE) 80 | Encoding(text) <- "UTF-8" 81 | close(fileConnection) 82 | text 83 | } 84 | 85 | loadHTML <- function(filename) { 86 | HTML(readFile(filename)) 87 | } -------------------------------------------------------------------------------- /run.R: -------------------------------------------------------------------------------- 1 | # run locally 2 | library(shiny) 3 | library(shinythemes) 4 | runApp("../p-checker") 5 | shiny::runApp("../p-checker", display.mode="showcase") -------------------------------------------------------------------------------- /snippets/about.html: -------------------------------------------------------------------------------- 1 |

About

2 | (c) 2018 by Felix Schönbrodt (www.nicebread.de). 3 | 4 |

Citation

5 | Programming this app took a considerable effort and amount of time. If you use it in your research, please consider citing the app, and of course the creators of the statistical tests: 6 |

7 | Schönbrodt, F. D. (2018). p-checker: One-for-all p-value analyzer. Retrieved from http://shinyapps.org/apps/p-checker/. 8 | 9 | 10 | The source code of this app is licensed under the open GPL-2 license and is published on Github.
11 |

12 | 13 | This Shiny app implements the p-curve (Simonsohn, Nelson, & Simmons, 2014; see http://www.p-curve.com) in its previous ("app2") and the current version ("app3"), the R-Index and the Test of Insufficient Variance, TIVA (Schimmack, 2014; see http://www.r-index.org/), and tests whether p values are reported correctly. 14 |

15 | p-curve code is to a large extent adapted or copied from Uri Simonsohn (see here). TIVA code adapted from Moritz Heene; original fasterParser and several GUI functions by Tobias Kächele. 16 |

17 | 18 |

Citation of tests

19 | Programming this app took a considerable effort and amount of time. If you use it in your research, please consider citing the app, and of course the creators of the statistical tests: 20 |

21 | Begg, C. B., & Mazumdar, M. (1994). Operating characteristics of a rank correlation test for publication bias. Biometrics, 1088–1101. 22 |

23 | Egger, M., Smith, G. D., Schneider, M., & Minder, C. (1997). Bias in meta-analysis detected by a simple, graphical test. Bmj, 315, 629–634. 24 |

25 | Schönbrodt, F. D. (2015). p-checker: One-for-all p-value analyzer. Retrieved from http://shinyapps.org/apps/p-checker/. 26 |

27 | Schimmack, U. (2014). Quantifying Statistical Research Integrity: The Replicability-Index. Retrieved from http://www.r-index.org 28 |

29 | Simonsohn, U., Nelson, L. D., & Simmons, J. P. (2014). P-curve: A key to the file-drawer. Journal of Experimental Psychology: General, 143, 534–547. doi:10.1037/a0033242 30 |

31 | Stanley, T. D., & Doucouliagos, H. (2014). Meta-regression approximations to reduce publication selection bias. Research Synthesis Methods, 5, 60–78. doi:10.1002/jrsm.1095 32 |

33 | 34 | 35 | 36 |

Disclaimer / Validity of the results

37 | I cross-validated the results with p-curve.com and did not find differences (unsurprisingly, as I use Uri's code for p-curve to a large extent). With a single click (see the "Export" tab) you can transfer the test statistics to p-curve.com and cross-validate the results yourself. 38 | I also checked the results with the R-Index Excel-sheet and did not find differences so far. 39 |
Nonetheless, this app could contain errors and a healthy scepticism towards the results is indicated. I always recommend to perform some plausibility checks. Feel free to go to the source code and check the validity yourself. If you suspect a bug or encounter errors, please send me an email with your test statistics and a description of the error. 40 | 41 |

Comments

42 | Any detected bugs, comments, and feature requests are welcome: felix@nicebread.de 43 |
44 | 45 | https://osf.io/3urp2/ 46 | 47 | 48 | 49 | Simonsohn, U., Nelson, L. D., & Simmons, J. P. (2014). P-curve: A key to the file-drawer. Journal of Experimental Psychology: General, 143, 534–547. doi:10.1037/a0033242 50 |

51 | Wetzels, R., Matzke, D., Lee, M. D., Rouder, J. N., Iverson, G. J., & Wagenmakers, E.-J. (2011). Statistical evidence in experimental psychology: An empirical comparison using 855 t tests. Perspectives on Psychological Science, 6, 291–298. doi:10.1177/1745691611406923 52 |

53 | Lakens, D. (2014). Professors are not elderly: Evaluating the evidential value of two social priming effects through p-curve analyses. doi: http://dx.doi.org/10.2139/ssrn.2381936. Retrieved from http://ssrn.com/abstract=2381936 54 |
55 | -------------------------------------------------------------------------------- /snippets/demo_syntax.txt: -------------------------------------------------------------------------------- 1 | #' @title Demo data 2 | #' @subtitle by Slartibartfast 3 | #' @details Go and replace the examples in the text box! # starts a comment 4 | #' @url http://shinyapps.org/apps/p-checker/ 5 | 6 | # Each line is one test statistic 7 | # Easy mode: only enter the test statistics with df 8 | t(47) = 2.1 9 | chi2(1) = 9.15 10 | r(77) = .47 11 | F(1, 88) = 9.21 12 | p = .02 13 | p(48) = .018 14 | 15 | # add reported p-value; mark one-tailed; set alpha level 16 | t(123) = 2.54; p < .01 17 | Z = 1.9; one-tailed; p=.03 18 | r(25) = 0.21; crit=.10 19 | 20 | # add paper ID 21 | A&B (2001) Study1: t(88)=2.1; one-tailed; p < .02 22 | A&B (2001) Study1: r(147)=.246 23 | A&B (2001) Study2: F(1,100)=9.1 24 | CD&E (2014) S1a: F(1,210)=4.45; p < .01 25 | CD&E (2014) S1b: t(123)=2.01; one-tailed; p = .02 26 | -------------------------------------------------------------------------------- /snippets/extended_manual.html: -------------------------------------------------------------------------------- 1 | 2 |

Manual

3 |

Data extraction:

4 | 5 | 40 | 41 |

Sign of effects

42 | You can provide the sign of a test statistic (e.g., t(123) = -2.8). This, however, is ignored in R-index, TIVA, and p-curve, which only use the p-values and ignore the sign. Hence, for these analyses by now it is implicitly assumed that all effects go into the predicted direction.
The meta-analysis tab, in contrast, respects the sign.
43 | 44 | 45 | 46 |

Special cases

47 | 48 | 52 | 53 |

Reproducible Analyses

54 | 55 | 57 | 58 | Copy the link below the text entry area for a reproducible analysis. This way you can share any p-value analysis in a single link! 59 | 60 |

Roxygen-style header for your analysis

61 | You can add title, subtitle, details, and an URL for your analysis in the syntax: 62 |
63 | 64 | #' @title The title of your analysis
65 | #' @subtitle by Slartibartfast
66 | #' @details Go and replace the examples in the text box!
67 | #' @url http://shinyapps.org/apps/p-checker/
68 |
69 | 70 | 71 |

Technical Details

72 | 73 | The Egger's test and PET-PEESE are implemented as: 74 |
75 | 76 | PET <- lm(d~d.se, data, weight=1/d.var)
77 | PEESE <- lm(d~d.var, data, weight=1/d.var)
78 |
79 | PET <- rma(yi = d, vi = d.var, mods=d.se, method="DL")
80 | PEESE <- rma(yi = d, vi = d.var, mods=d.var, method="DL")
81 |
-------------------------------------------------------------------------------- /snippets/quick_start.html: -------------------------------------------------------------------------------- 1 |

Quick Start

2 | Enter test statistics in the text field on the left. You can just enter the plain statistics (see the first four lines of the example), or you can add additional information:
3 |
15 |
16 | Possible test statistics: 17 | 25 | 26 | The numbers in the brackets generally are degrees of freedom. In the case of correlations (r-values), the df often are not explicitly provided in the results sections; they are N-2. 27 |
28 | If two numbers are provided for chi2, the first are the dfs, the second is the sample size (e.g., chi2(1, 326) = 3.8) 29 |
30 | in the case of z-values and p-values, the number in parentheses is the sample size (e.g., p(52) = 0.02) -------------------------------------------------------------------------------- /snippets/responsibly.html: -------------------------------------------------------------------------------- 1 | 2 |

Terms of Use

3 | Have fun playing around with p-checker! This web application provides several tests for publication bias/p-hacking/indicators for data-dependent analyses, whatever term you prefer. Some of them are new, unpublished, and controversial to some extent; purpose of this app is to provide a unified place for trying out and comparing these methods. Please use the tests with care. 4 |
5 | When you do an actual analysis, remember: 6 | 13 |
14 | I strongly recommend to read Simonsohn et al.'s (2014) p-curve paper. They have sensible recommendations and rules of thumb which papers and test statistics to include in an analysis. -------------------------------------------------------------------------------- /snippets/version_history.html: -------------------------------------------------------------------------------- 1 |

Release notes / Version history

2 | 3 |

Version 0.7 (2018-01-15)

4 | 5 | Changes: 6 |
7 | 26 | 27 |

Version 0.6.2 (2016-10-04)

28 | 29 | Changes: 30 |
31 | 39 | 40 |

Version 0.6.1 (2016-06-14)

41 | 42 | Changes: 43 |
44 | 52 | 53 | 54 |

Version 0.6 (2016-02-22)

55 | 56 | Changes: 57 |
58 | 62 | 63 | 64 |

Version 0.5 (2016-02-15)

65 | 66 | Changes: 67 |
68 | 74 | 75 |

Known issues:

76 | -------------------------------------------------------------------------------- /tests.R: -------------------------------------------------------------------------------- 1 | x = "1: t(88)=2.1; crit = .10" 2 | x = "r(147)=.246" 3 | x = "F(1,100)=9.1" 4 | x = "f(2,210)=4.45" 5 | x = "Z=3.45" 6 | x = "chi2(1)=9.1" 7 | x = "r(77)=.47" 8 | 9 | parse_ES1("3: t(88)=2.1; crit = .10; p < .04", round_up=TRUE) 10 | parse_ES1("r(147)=.246") 11 | parse_ES1("test: F(1,100)=9.1") 12 | parse_ES1("f(2,210)=4.45") 13 | parse_ES1("Z=3.45") 14 | parse_ES1("chi2(1)=9.1") 15 | parse_ES1("r(77)=.47") 16 | 17 | 18 | x <- c(" 19 | a1: t(88)=2.1; crit=.10 20 | a1: r(147)=.246 21 | a1: F(1,100)=9.1; crit = .08 22 | f(2,210)=4.45 23 | Z=3.45 24 | chi2(1)=9.1 25 | r(77)=.47") 26 | 27 | 28 | x <- c(" 29 | t(88)=2.1 30 | r(147)=.246 31 | F(1,100)=9.1 32 | f(2,210)=4.45 33 | Z=3.45 34 | chi2(1)=9.1 35 | r(77)=.47 36 | chi2(2)=8.74 37 | ") 38 | 39 | tbl2 <- parse_ES(txt) 40 | 41 | 42 | # Test wrong syntax 43 | 44 | parse_ES1("3: t(88, 2)=2.1; crit = .10; p < .04", round_up=TRUE) 45 | r <- parse_ES("3: t(88, 2)=2.1; crit = .10; p < .04") 46 | attr(r, "warnings") 47 | -------------------------------------------------------------------------------- /tests/Dunlap paired t-tests.R: -------------------------------------------------------------------------------- 1 | library(effsize) 2 | 3 | x <- c(27, 25, 30, 29, 30, 33, 31, 35) 4 | y <- c(21, 25, 23, 26, 27, 26, 29, 31) 5 | D <- x-y 6 | 7 | t.test(D, mu=0) 8 | t.test(x, y) 9 | t.test(x, y, paired=TRUE) 10 | 11 | cohen.d(x,y) 12 | tes(t.test(x, y)$statistic, length(x), length(y)) 13 | 14 | cohen.d(x,y, paired=TRUE) 15 | 16 | # t(14)=2.530 17 | # t(7) = 4.513 18 | # t(7) = 4.513 -------------------------------------------------------------------------------- /ui.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shinyjs) 3 | library(shinythemes) 4 | library(shinyBS) # Additional Bootstrap Controls 5 | #library(ggvis) 6 | 7 | # Load the panels with the manual etc. 8 | source("pancollapse.R") 9 | 10 | # custom js function to open external URL 11 | jsCode <- "shinyjs.browseURL = function(URL){window.open(URL, ''); ;}" 12 | 13 | shinyUI(tagList( 14 | 15 | # https://github.com/daattali/shinyjs#using-shinyjs-with-navbarpage-layout 16 | useShinyjs(), 17 | extendShinyjs(text = jsCode, functions=c("browseURL")), 18 | 19 | navbarPage(title="", 20 | tabPanel("p-checker", 21 | # --------------------------------------------------------------------- 22 | # The actual app ... 23 | HTML("

p-checker The one-for-all p-value analyzer

"), 24 | fluidRow( 25 | 26 | column(width=5, 27 | div(id="leftCol", 28 | 29 | h3("Enter test statistics here:"), 30 | # the syntax input text field is constructed by ther server.R 31 | uiOutput("syntax"), 32 | br(), 33 | downloadButton('downloadData','Save input as CSV file', class="btn-sm"), 34 | uiOutput("exportlink"), 35 | 36 | tags$hr(), 37 | tags$h3("Test-specific options"), 38 | 39 | conditionalPanel( 40 | condition = "input.tabs1 == 'p-Curve' | input.tabs1 == 'Excess Significance' | input.tabs1 == 'TIVA'", 41 | checkboxInput("group_by_paper", "Group results by paper", FALSE), 42 | checkboxInput("only_first_ES", "Only use first test statistic of each study", FALSE), 43 | helpText("Usually, only one effect size should be extracted for each sample. Manually choose the focal effect size, or use this checkbox to only include only the first ES of each study.") 44 | ), 45 | 46 | conditionalPanel( 47 | condition = "input.tabs1 == 'p-Curve'", 48 | selectInput('pcurve_version','p-curve Version:', c( 49 | "Version 2 (chi2 test)"="v2", 50 | "Version 3 (Z test) - recommended"="v3" 51 | ), selected="v3"), 52 | sliderInput("pcurve_power", "Comparison power (default = 33%)", min=10, max=99, value=33, step=1) 53 | ), 54 | 55 | conditionalPanel( 56 | condition = "input.tabs1 == 'Meta-analysis'", 57 | checkboxInput("show_PET", "Show PET meta-regression in plot", TRUE), 58 | checkboxInput("show_PEESE", "Show PEESE meta-regression in plot", TRUE), 59 | selectInput('MR_model','Meta-regression model', c( 60 | "Using the lm() function"="lm", 61 | "Using the rma() function"="rma" 62 | ), width="100%") 63 | ), 64 | 65 | conditionalPanel( 66 | condition = "input.tabs1 == 'p-Curve' & input.experimental == 1", 67 | sliderInput("pcurve_crit", "Critical p value (EXPERIMENTAL! Only intended for exploration, not for actual p-curve analyses! Default = .05)", min=.01, max=.10, value=.05, step=.01) 68 | ), 69 | 70 | conditionalPanel( 71 | condition = "input.tabs1 == 'Excess Significance'", 72 | checkboxInput("omit_nearly_significant", "Omit 'nearly significant' p-values (range: see below) from R-Index analysis.", FALSE), 73 | sliderInput("omit_nearly_significant_range", "Range of 'nearly significant'", min=.0, max=.20, value=c(.05, .10), step=.005) 74 | ), 75 | 76 | tags$hr(), 77 | tags$h3("General options"), 78 | 79 | numericInput("digits", "Digits in display:", 3, min = 0, max = 5), 80 | checkboxInput("round_up", "Gracious rounding up", FALSE), 81 | helpText("If the t value is reported as 2.1, it could also be 2.14999 which has been rounded down. If you want to be maximally generous, you can check this box, and all test statistics are automatically increased by X.XX4999."), 82 | 83 | br(),br(), 84 | selectInput('demodata','Load demo data', c( 85 | "---"="---", 86 | "Power posing by @jpsimmon"="powerposing", 87 | "Glucose and self-control by @mavadillo"="glucose", 88 | "Elderly priming analysis by @lakens"="elderly", 89 | "Non-hacked JPSP data (Simonsohn et al., 2014, Figure 3B)"="JPSP1", 90 | "855 t-tests (Wetzels et al., 2011)"="855", 91 | "H0 sim: 100 papers with 5 studies; d = 0; selective reporting"="H0_100x5", 92 | "H1 sim: 100 papers with 5 studies; d = 0.5; selective reporting"="H1_100x5", 93 | "Hack sim: 100 papers with 5 studies; d = 0; hacked; selective reporting"="H0_hack_100x5" 94 | ), width="100%"), 95 | 96 | br(), 97 | checkboxInput("experimental", "Activate experimental options (Do not run actual analyses with these experimental/untested options!)", FALSE), 98 | bsPopover(id = "experimental", title="A", content = "Do not run actual analyses with these experimental/untested options!", placement = "right", trigger = "hover") 99 | ) # end of div id="leftCol" 100 | ), 101 | 102 | 103 | 104 | ## ====================================================================== 105 | ## The output panels, on the right side 106 | ## ====================================================================== 107 | 108 | column(width=7, 109 | 110 | #alert.create('New feature: You can now enter p-values directly (e.g. p=0.021). If you provide the sample size in addition (e.g. p(48)=.03), the p-value is also converted into an effect size.', style="success"), 111 | 112 | alert.create("Disclaimer: This web application provides several tests for publication bias/p-hacking/indicators for data-dependent analyses. Some of them are new, unpublished, and controversial to some extent; purpose of this app is to provide a unified place for trying out and comparing these methods. Please use the tests with care, and RTM of the tests. (You can dismiss this message by clicking 'X')", style="info"), 113 | 114 | # show ROxygen-style title if provided in the syntax 115 | htmlOutput("roxygen_title"), 116 | 117 | # show warning if experimental features are activated 118 | htmlOutput("experimental_features_warning"), 119 | 120 | # show potential parser errors on top of output 121 | htmlOutput("parser_errors"), 122 | 123 | tabsetPanel(id ="tabs1", 124 | tabPanel("Excess Significance", 125 | htmlOutput("rindex_summary"), 126 | conditionalPanel( 127 | condition = "input.group_by_paper == 1", 128 | downloadButton('downloadRIndex','Save R-Index results as CSV file', class="btn-sm") 129 | ), 130 | HTML('For information about R-Index, see https://replicationindex.com.'), 131 | htmlOutput("rindex_table") 132 | ), 133 | tabPanel("TIVA", 134 | alert.create('The TIVA test expects that all entered test statistics/p-values are in the expected direction (regardless of the sign). Please delete or comment out all rows with results in the "wrong" direction.'), 135 | htmlOutput("tiva_summary"), 136 | conditionalPanel( 137 | condition = "input.group_by_paper == 1", 138 | downloadButton('downloadTIVA','Save TIVA results as CSV file', class="btn-sm") 139 | ), 140 | HTML('For information about TIVA, see replicationindex.wordpress.com.'), 141 | htmlOutput("tiva_table") 142 | ), 143 | tabPanel("p-Curve", 144 | conditionalPanel( 145 | condition = "input.group_by_paper == 0", 146 | htmlOutput("pcurve_plot") 147 | ), 148 | htmlOutput("pcurve_summary"), 149 | conditionalPanel( 150 | condition = "input.group_by_paper == 1", 151 | downloadButton('downloadPCurve','Save p-curve results as CSV file', class="btn-sm") 152 | ), 153 | HTML('For information about p-curve, see http://p-curve.com/.
154 | Simonsohn, U., Nelson, L. D., & Simmons, J. P. (2014). P-curve: A key to the file-drawer. Journal of Experimental Psychology: General, 143, 534–547. doi:10.1037/a0033242 155 |
'), 156 | tableOutput("pcurve_table") 157 | ), 158 | tabPanel("Meta-analysis", 159 | br(), 160 | alert.create('The test statistics are converted to Cohen\'s d wherever possible, based on the formulas provided by Borenstein, Hedges, Higgins, & Rothstein (2011). Warning: These effect size conversions are based on approximative formulas; furthermore the app always assumes equal cell sizes and other simplifications. Although these proxies work good under many conditions, this quick meta-analytic overview cannot replace a proper meta-analysis!'), 161 | #ggvisOutput("ES_plot"), 162 | # show potential parser errors on top of output 163 | htmlOutput("MA_warnings"), 164 | htmlOutput("effectsizes") 165 | 166 | ), 167 | # tabPanel("Research style analysis (beta)", 168 | # htmlOutput("researchstyle") 169 | # ), 170 | tabPanel("p values correct?", 171 | htmlOutput("report_table") 172 | )#, 173 | # tabPanel("Export", 174 | # tableOutput("export") 175 | # )#, 176 | #tabPanel("Demo data", 177 | # htmlOutput("demodata") 178 | #) 179 | ) 180 | ) 181 | ) 182 | ), 183 | tabPanel('Quick Start', loadHTML('snippets/quick_start.html')), 184 | tabPanel('Manual', loadHTML('snippets/extended_manual.html')), 185 | tabPanel('Terms of Use', loadHTML('snippets/responsibly.html')), 186 | tabPanel('About', loadHTML('snippets/about.html')), 187 | tabPanel('Release Notes', loadHTML('snippets/version_history.html')), 188 | header = pancollapse(), 189 | theme = shinytheme("spacelab"), 190 | # load custom css to override some theme settings 191 | tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "p-checker-theme.css")), 192 | windowTitle = "One-for-all p-value analyzer" 193 | ))) 194 | -------------------------------------------------------------------------------- /www/accordion.css: -------------------------------------------------------------------------------- 1 | @import url('//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css'); 2 | 3 | /* CSS Method for adding Font Awesome Chevron Icons */ 4 | .accordion-toggle:after { 5 | /* symbol for "opening" panels */ 6 | font-family:'FontAwesome'; 7 | content:"\f077"; 8 | float: right; 9 | color: inherit; 10 | } 11 | .panel-heading.collapsed .accordion-toggle:after { 12 | /* symbol for "collapsed" panels */ 13 | content:"\f078"; 14 | } -------------------------------------------------------------------------------- /www/busy.css: -------------------------------------------------------------------------------- 1 | div.busy { 2 | position:absolute; 3 | top: 40%; 4 | left: 50%; 5 | margin-top: -100px; 6 | margin-left: -50px; 7 | display:none; 8 | background: rgba(230, 230, 230, .8); 9 | text-align: center; 10 | padding-top: 20px; 11 | padding-left: 30px; 12 | padding-bottom: 40px; 13 | padding-right: 30px; 14 | border-radius: 5px; 15 | } -------------------------------------------------------------------------------- /www/busy.js: -------------------------------------------------------------------------------- 1 | setInterval(function() { 2 | if ($('html').attr('class')=='shiny-busy') { 3 | setTimeout(function() { 4 | if ($('html').attr('class')=='shiny-busy') { 5 | $('div.busy').show() 6 | } 7 | }, 1000) 8 | } else { 9 | $('div.busy').hide() 10 | } 11 | }, 100) 12 | -------------------------------------------------------------------------------- /www/demo-pics/powerposing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/www/demo-pics/powerposing.jpg -------------------------------------------------------------------------------- /www/loading.css: -------------------------------------------------------------------------------- 1 | div.loading { 2 | position:absolute; 3 | top: 40%; 4 | left: 50%; 5 | margin-top: -100px; 6 | margin-left: -50px; 7 | display:none; 8 | background: rgba(230, 230, 230, .8); 9 | text-align: center; 10 | padding-top: 20px; 11 | padding-left: 30px; 12 | padding-bottom: 40px; 13 | padding-right: 30px; 14 | border-radius: 5px; 15 | } 16 | -------------------------------------------------------------------------------- /www/p-checker-theme.css: -------------------------------------------------------------------------------- 1 | #leftCol { 2 | background-color: #fafafa; 3 | padding: 10px; 4 | } -------------------------------------------------------------------------------- /www/pancollapse.css: -------------------------------------------------------------------------------- 1 | .panel-heading-collapse { 2 | cursor: pointer; 3 | } -------------------------------------------------------------------------------- /www/pancollapse.js: -------------------------------------------------------------------------------- 1 | $(document).on('click', '.panel-heading-collapse', function(e){ 2 | var panel = $(this).parents('.panel'); 3 | var panelBody = panel.find('.panel-body'); 4 | if(!panelBody.hasClass('panel-collapse')) { 5 | panelBody.slideUp(); 6 | panelBody.addClass('panel-collapse collapse'); 7 | } else { 8 | panelBody.slideDown(); 9 | panelBody.removeClass('panel-collapse collapse'); 10 | } 11 | panel.find('i').toggleClass('glyphicon-chevron-up glyphicon-chevron-down'); 12 | }); -------------------------------------------------------------------------------- /www/preloader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicebread/p-checker/636cd92036dcaa5f6761dd23ba08ffe064d02eaf/www/preloader.gif -------------------------------------------------------------------------------- /www/showstartmessage.js: -------------------------------------------------------------------------------- 1 | $(document).ready( 2 | function(){ 3 | $('div.loading').show(); 4 | }); 5 | --------------------------------------------------------------------------------