statrefs home‎ > ‎Main‎ > ‎Methods‎ > ‎Data Management‎ > ‎

Expand Grouped Data to Individual Cases



For experiments based on Logistic Regression, the data can come in several formats.  One format is 'grouped' data, with a code variable (such as Pass/Fail, 1/0) and a count variable.

There are some logistic regression methods that require the data to be in the form of individual cases.  For larger data sets, it can be very time consuming to manually (in Excel or otherwise) change the format from grouped data to individual cases.

This example shows one method for changing a data set from grouped data to individual cases.  The R file below "Expand Grouped Data to Individual Cases.R.txt" is built specifically to work with the attached data set "Expand Grouped Data (data set).csv".

When time permits, the R code can be changed to accommodate more general cases.  In the meantime, the R code can be modified to work for most specific situations.


 

 
Comments