How to install R
If you have not previously used R or RStudio, it is easy to download and install them, and you will be able to use them right away via the code-exporting feature of RegressIt. Here's how to proceed.
How does it work? What RegressIt actually does is to write the analysis code to a script file, which is a text file with an "r" extension. It could contain as many as several hundred lines of code, depending on the number of outputs that are produced. You can choose a location for the script file at the time the code is generated (the default is the Excel file location). At the same time, RegressIt copies a single line of code for running the script file to the clipboard. (This line begins with "source".) When you paste and run that line of code in the console, it will execute the code in the script file. You can open up the script file with any text editor (including Word) if you want to see what the code looks like. You can edit or step through the code by opening the script file in the Source pane in the RStudio window. To fully understand how R works and how to use it more generally, you should consult some of the many online sources.
Click here to proceed to the next page: RegressIt to R.
If you have not previously used R or RStudio, it is easy to download and install them, and you will be able to use them right away via the code-exporting feature of RegressIt. Here's how to proceed.
- You need to install R first, then RStudio. Go the web page with the list of mirror sites from which to download R: https://cran.r-project.org/mirrors.html. Click on the link for one that is close to you.
- Next you will see a page that says "The Comprehensive R Archive Network" with links to download it for Windows and MacOSX. Click the link for your operating system.
- If you are a PC user, click "Install R for the first time", then "Download R 3.x.x" (whatever is current), then choose the Save-file option to save the installation file to your Download folder. Go to the download list for your browser and click "Open containing folder" (Firefox) or "Show in folder" (Chrome) or just "Open" (Explorer). Double-click on the exe file, click "Run", then agree to everything that follows.
- If you are a Mac user, click "R-3.x.x.pkg" (it is partway down the page), then choose "Save file". Then go to your Downloads folder (Finder/Windows/Downloads) and double-click on the saved file to begin installing it, then agree to everything that follows.
- 4. Go to the RStudio download page: https://www.rstudio.com/products/rstudio/download/. Click the "Download Rstudio Desktop [for your operating system]" button. Then follow the same steps that you followed to install R: go to your downloads folder, double-click on the executable file, and agree to everything.
- 5. You should now find RStudio among your list of installed applications. When you run it, it should open a Console pane with a command prompt (>). (The first time you do this, some additional files will probably be loaded first.) Just come to this pane and hit <Paste><Enter> at the command prompt any time you want to run some code that has just been generated for you by RegressIt. ("Paste" means Ctrl-V on a PC or Cmd-V on a Mac.)
- 6. To the right of the console pane is a File/Plots/Packages pane with several tabs. (If you don't see this, go to View/Panes on the menu.) Click the Plot tab to show the space where plots will appear. Some of the procedures that you run will generate multiple pages of plots, and you can use the arrow keys above the plot window to flip back and forth. If plots are generated in your session, you may need to adjust the width of the console window or the plot pane so that it is large enough to display everything, otherwise you may see an error message.
- Launch Excel, open your data file, open the RegressIt program file (choose "Enable macros"), and use the Select-Data and Create-Names buttons to define your variables if you haven't already.
- Now you're all set for analysis. Click the Linear Regression button on the RegressIt menu, choose the variables for your model, check the "R code only" box, and hit Run. This will open the generate-R-code menu from which to select options for your analysis in R.
- Before running the first model in your session, you will need to load about a dozen packages of additional functions which are used by the code that RegressIt produces. RegressIt will handle the details of this for you. Just click the Packages button on the generate-R-code menu, then hit <Paste><Enter> at the command prompt in RStudio which will run the necessary code for loading the packages. This only needs to be done once (prior to exiting from RStudio)
- To run your model, check the boxes for the analysis options you want, then hit the Run button, then go to the command prompt in RStudio and hit <Paste><Enter>. If you checked the box for "Export model summary to R", you can go back to Excel and hit the Import R button on the menu to import the results on a new worksheet.
- For complete details on how to use it, see this document: https://regressit.com/RegressItInterfaceWithR.pdf
How does it work? What RegressIt actually does is to write the analysis code to a script file, which is a text file with an "r" extension. It could contain as many as several hundred lines of code, depending on the number of outputs that are produced. You can choose a location for the script file at the time the code is generated (the default is the Excel file location). At the same time, RegressIt copies a single line of code for running the script file to the clipboard. (This line begins with "source".) When you paste and run that line of code in the console, it will execute the code in the script file. You can open up the script file with any text editor (including Word) if you want to see what the code looks like. You can edit or step through the code by opening the script file in the Source pane in the RStudio window. To fully understand how R works and how to use it more generally, you should consult some of the many online sources.
Click here to proceed to the next page: RegressIt to R.