Updated Bootstrapped PCA function for R (aka Bubbles Machine)
Requires 1 .csv file with no column or row headers
Rows - use up to six rows - each is a different case (and produces a different bubble) - more than six rows will produce a warning and additional rows will be removed
Columns - use up to 19 columns - one for each behaviour. Statistically a minimum of five behaviours should be considered. More than 19 will produce several error messages, and results should not be used
Data - all data must be integers - each row must add to 100
To run:
Download, open and run file - which is a function called 'bubbles' - nothing will happen when you run this as long as all libraries etc are installed (rgl is needed)
Type install.packages("rgl") to install if it isn't already installed
Run the bubbles function:
bubbles(filename="Example_Data.csv", 1000, 95) # note - you can include a path to the file, if it isn't in the same directory or folder as the r file e.g. "C:\Users\Rick\Desktop\Bubbles Simplified\Example_Data.csv"
This should now produce the required plots - change the 1000 to 10000 for increased accuracy, but leave at 1000 for exploring data - it will take a minute or so for the plot to be produced
Details:
bubbles(filename, bootstrapsize, confidence.level)
The second argument to the function or the first number is the size of the bootstrap - suggest 1000 for explanatory analysis, and 10000 for any final analysis
the third argument is confidence.level, where you put a number to specify the confidence level you wish to examine as a percentage (99, 95, 80 etc)
Output:
Output is the bubble plot and the summary of the PCA, indicating the cumulative proportion of variability explained. The proportion of variance explained by the first three PCs should be > 0.9 and ideally > 0.95