Written by: STATISTICA 7/27/2010 11:13 AM
Your data has a known pattern. It may have groups or categories of data. But this pattern is inside of your head rather than a variable. You need to create a new variable to express this pattern for your analysis project.
Maybe you have five different DNA groups. Or you need to label your training data for a credit scoring project.
You can autofill (auto calculate) values by dragging your mouse pointer across the data. But does anyone really want to drag through 1,000 or 100,000 rows of data?
There is a faster method. You can create variables with patterns via a STATISTICA Visual Basic (SVB) macro. This type of macro is useful for placing into a column the levels of a factor in ANOVA designs.
We have an example macro Patterned Data Complete that can be downloaded.
Here is a quick example that shows how the macro can be used.
We have a data set with 2,415 cases. There are 5 DNA groups. Group 1 is in case 1, 6, 11, etc.. Group 2 is in case 2, 7, 12, etc..
Our start value is 1 and our end value is 5. We want to add 1 (increment) to the counter. We want to repeat the sequence for the data set, so 2,415 / 5 = 483.
/Angela Waner
Image Credit: http://www.flickr.com/photos/webtreatsetc/4721242479/
0 comment(s) so far...