ebook img

QCA with R PDF

289 Pages·2019·5.435 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview QCA with R

Adrian Dus ̦a QCA with R A Comprehensive Resource R QCA with Adrian Dusa , R QCA with A Comprehensive Resource 123 AdrianDus,a RomanianSocialDataArchive UniversityofBucharest Bucharest,Romania ISBN978-3-319-75667-7 ISBN978-3-319-75668-4 (eBook) https://doi.org/10.1007/978-3-319-75668-4 LibraryofCongressControlNumber:2018933067 ©SpringerInternationalPublishingAG,partofSpringerNature2019 Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpartof thematerialisconcerned,specificallytherightsoftranslation,reprinting,reuseofillustrations,recitation, broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,andtransmissionorinformation storageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilarmethodology nowknownorhereafterdeveloped. Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant protectivelawsandregulationsandthereforefreeforgeneraluse. Thepublisher,theauthorsandtheeditorsaresafetoassumethattheadviceandinformationinthisbook arebelievedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsorthe editorsgiveawarranty,expressorimplied,withrespecttothematerialcontainedhereinorforanyerrors oromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictionalclaims inpublishedmapsandinstitutionalaffiliations. Printedonacid-freepaper ThisSpringerimprintispublishedbytheregisteredcompanySpringerInternationalPublishingAGpart ofSpringerNature. Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland Preamble TheinitialideatowritethisbookemergedinAugust2016,withtheintention toupdatethedescriptionofpackageQCAinR.Alotofthingshavechanged sincetheappearanceoftheprevioususerguide5yearsago,whenthepackage reached version 1.0-0. Most of the commands are backwards compatible, meaning that all examples from the previous guide still work with the current version of the package. There are some minor but important differences; for instance, the function calibrate() has its default changed from type = "crisp" to type = "fuzzy". Examples still work with previous versions, but for crisp calibration the ar- gument type = "crisp" should be explicitly specified. All changes, from all versions of the package, are specified in the ChangeLog file which is located in the package’s installation directory (details in chapter2). Thisbookiscorrelatedwiththereleaseofversion3.3ofthepackage.Thereare many new, cutting-edge features that were not available before: dramatically improved functionality and of course a graphical user interface to enable R beginners to use this package using a point and click method. If previously it was all about the command line, now it is all about the interconnection between the command line and the graphical user interface. To advance the presentation from section2.4, the point of the graphical user interfaceisnottoreplacethecommandlinebuttoofferamoreaccessibleway to learn how to use the commands. No graphical user interface, irrespective of how user friendly, can replace the complete flexibility of the command line. The variety of available written functions, from the base R and specifically from package QCA, is beyond the possibilities of any standardized graphical (therefore confined) user interface. But there is one thing that makes this user interface special: each and every mouse click on the various options triggers an immediate construction of the corresponding command. The real purpose of the graphical user interface is v vi Preamble to demonstrate one possible way to write commands, while there are many others that users are invited to discover. The structure of this book is different from the former user guide. It will of coursetouchonthesametopicsandpresentthesame(updated)package,but instead of organizing chapters on the distinction between crisp, multi-value and fuzzy sets, a better approach is to organize the book on QCA-related analyses:calibration,analysisofnecessity,analysisofsufficiency,constructing and minimizing a truth table, etc. It has grown to be much more than a guide, but it is also not intended as a complete theoretical material. This is valid for both R-related information (chapter1beingaveryshortintroduction)andQCA-relatedtopics.Thereare entirebookstocovereach,andthisbookcannotreplacethemall,butinstead it shifts the focus on how to perform QCA using R. There are dedicated chapters combining theory for all QCA variants (cs, mv and fs, also extensions) and R, with detailed instructions on how to perform each of the analyses using both command line and the new graphical user interface.Readersareneverthelessinvitedtosupplementtheirknowledgefrom other sources, most being introduced in the specific sections. To say that writing this book has been a challenge is an understatement. It startedasachallenge,butithasdevelopedintosomethingIdefinitelydidnot anticipate. The text in the book is written for an imaginary character with whom I had many interesting discussions emerging from natural questions. This character can be both a QCA expert who is interested in using R and an R expert who is interested in QCA, or perhaps the most common scenario someone who is neither a QCA nor an R expert. But the questions are the same: (cid:129) What exactly is this? and/or (cid:129) How do I do it with R? Many sections and paragraphs, sometimes down to each word, had to be rewritten while conversing with this imaginary character and trying to antici- pate what kind of questions and what kind of answers are expected from this book. During all this process of describing and explaining, I have often real- ized that many things that I took for granted were not exactly trivial. This was practically an invitation to rethink and rewrite the structure of the com- mands to better answer possible questions, while at the same time increasing the user experience. Much like a sculptor who has a concrete idea about the potential of a statue to be carved out from a stone, the initial book plan gradually adapted to the new structure to accommodate all ideas that have emerged while writing it. In a way, the book wrote itself, just as the statue that already exists inside the stone and the sculptor only removes the excess material to reveal it. I am extremely pleased to have actively experienced this process. Preamble vii Naturally, improving the code in the package implied further and better ex- planations in the book, while describing the concepts many times involved rewriting the code, into an energy-draining spiral that lasted for almost an entire year. On top of the book, and on top of the code, every change meant even more additional effort to update the graphical user interface. In the absence of a formal background in programming, writing the package and especially the graphical user interface was a Herculean effort. In order to circumvent differences between operating systems, the natural choice is to open dialogs into the most universal environment, a web page. Thankfully, using the excellent package shiny made this effort manageable, althoughIstillhadtolearnHTML,JavascriptandSVGintheprocess.Ithas now reached a rather stable and easy to manage backend, while the front end is very close to an ideal, combining point and click dialogs with a web-based command line, all in the same workspace. The only important thing that it still lacks, and will certainly stay on the development list for the next versions, is a code editor. There are a number of verygood choices to pick from, but this is something Isimply didnot have thetimetodoforthisbook.Mostlikely,thenextversionsofthepackagewill be geared towards completing the graphical user interface. Risagreatenvironmentandfewpeopleareawarethatitcanbeusedtowrite books. Not surprisingly, this book was written using R. There are not enough wordstodescribetheamazingworkofYihuiXieandalltheteamofengineers fromRStudio,whoprovidethispublicserviceandespeciallyforthepackages knitr,rmarkdown andbookdown thatallowthisformofHTML,PDFand ebook publication (among others). It made the writing of this book a whole lot easier than I had expected, by automatically transforming the markdown code into LaTeX and finally rendered into an eye-candy PDF version. In the book, there are many places where theoretical information is exempli- fied using R commands. These are placed into specific grey boxes, and they havecoloursassociated(forinstance,allfunctionshaveredcolour,arguments are green and text input is blue). With the exception of very few commands that are only illustrative, all of them have an output which is printed imme- diately below, using a monospaced font. I am deeply thankful to a select group of people who contributed feedback whilewritingthebook,andevenprovidedideastofurtherimprovethepackage functionality: to Eva Thomann, Omar Bautista González and Monica S,erban for the very careful reading of the entire book text, and to Ioana-Elena Oana and Carsten Schneider for all their work making the package SetMethods work smoothly with package QCA. Therehavebeennumerousothersuggestions,bugreportsandfeaturerequests from too many people to mention here, and I very much appreciate all their interest. viii Preamble I would like to dedicate this book to my wife Adriana Rotar, who has been overly patient with me while writing it. I have taken time out from too many common activities, and I am grateful beyond words for being so understand- ing. Bucharest, Romania Adrian Dus,a November 2017 Contents 1 R Basics ................................................. 1 1.1 Working Directory..................................... 3 1.2 Workspace............................................ 4 1.3 Object Types ......................................... 5 1.4 Mathematical and Logical Operations.................... 8 1.5 Indexing and Subsetting................................ 10 1.6 Data Coercion ........................................ 13 1.7 User Interfaces ........................................ 15 1.8 Working with Script Files .............................. 17 2 The QCA Package....................................... 19 2.1 Installing the QCA Package............................ 19 2.2 Structure............................................. 20 2.3 Command Line Mode .................................. 22 2.3.1 Getting Help ................................... 22 2.3.2 Function Arguments ............................. 23 2.4 The Graphical User Interface (GUI) ..................... 26 2.4.1 Description ..................................... 27 2.4.2 Starting the Graphical User Interface .............. 29 2.4.3 Creating an Executable Icon...................... 30 2.4.4 Command Construction .......................... 32 2.4.5 The Web R Console ............................. 34 2.4.6 Graphics ....................................... 36 2.4.7 The Data Editor ................................ 39 2.4.8 Import, Export and Load Data.................... 41 3 Set Theory .............................................. 47 3.1 The Binary System and the Boolean Algebra ............. 48 3.2 Types of Sets ......................................... 48 3.2.1 Bivalent Crisp Sets .............................. 49 3.2.2 Multivalent Crisp Sets ........................... 50 3.2.3 Fuzzy Sets...................................... 52 ix x Contents 3.3 Set Operations ........................................ 53 3.3.1 Set Negation.................................... 53 3.3.2 Logical AND ................................... 54 3.3.3 Logical OR ..................................... 57 3.4 Complex Operations ................................... 59 4 Calibration .............................................. 61 4.1 Calibrating to Crisp Sets ............................... 63 4.2 Calibrating to Fuzzy Sets............................... 71 4.2.1 Direct Assignment............................... 72 4.2.2 Direct Method, the “S-Shape” Functions ........... 74 4.2.3 How Does It Works: The Logistic Function ......... 85 4.2.4 Direct Method, the “Bell-Shape” Functions ......... 88 4.2.5 The Indirect Method............................. 92 4.3 Calibrating Categorical Data............................ 94 5 Analysis of Necessity .................................... 99 5.1 Conceptual Description ................................ 99 5.2 Inclusion/Consistency.................................. 105 5.3 Coverage/Relevance ................................... 110 5.4 Necessity for Conjunctions and Disjunctions .............. 119 5.5 Exploring Possible Necessity Relations ................... 122 6 Analysis of Sufficiency................................... 125 6.1 Conceptual Description ................................ 126 6.2 Inclusion/Consistency.................................. 130 6.3 The PRI Score ........................................ 134 6.4 Coverage: Raw and Unique ............................. 136 7 The Truth Table......................................... 139 7.1 General Considerations................................. 139 7.2 Command Line and GUI Dialog......................... 143 7.3 From Fuzzy Sets to Crisp Truth Tables................... 146 7.4 Calculating Consistency Scores.......................... 151 7.5 The OUTput Value .................................... 154 7.6 Other Details ......................................... 158 8 The Logical Minimization................................ 159 8.1 Command Line and GUI Dialog......................... 161 8.2 Conservative (Complex) Solutions ....................... 163 8.3 What Is Explained .................................... 167 8.4 Parsimonious Solutions................................. 172 8.5 A Note on Complexity ................................. 176 8.6 Types of Counterfactuals ............................... 178 8.7 Intermediate Solutions: SA and ESA..................... 183 8.8 Theory Evaluation..................................... 194

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.