Hi everyone!
I have data on students exam scores and dates. Here is a subset of the data:
Variables description:
However, I want the shuffle to generate reasonable combinations of n_week and n_day. For example, the shuffled combination in the sixth row (id == 1 and test_date == 16615) does not make sense because the number of weekly exams is 1 (n_week == 1) and the number of daily exams is 2 (n_day == 2). Put it differently, n_day should not exceed n_week.
I'd appreciate your help!
I have data on students exam scores and dates. Here is a subset of the data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long id int test_date float(day_order week n_week n_day) 1 16560 1 283 1 1 1 16579 1 286 1 1 1 16589 1 287 2 2 1 16589 2 287 2 2 1 16602 1 289 1 1 1 16615 1 291 2 1 1 16618 1 291 2 1 4 15465 1 127 3 1 4 15467 1 127 3 2 4 15467 2 127 3 2 4 15481 1 129 1 1 4 15494 1 131 1 1 4 15500 1 132 1 1 4 15517 1 134 1 1 8 15833 1 179 1 1 8 15847 1 181 1 1 8 15858 1 183 2 2 8 15858 2 183 2 2 8 15864 1 184 2 1 8 15866 1 184 2 1 8 15871 1 185 3 1 8 15873 1 185 3 2 8 15873 2 185 3 2 8 15878 1 186 2 1 8 15882 1 186 2 1 end format %td test_date
- id: student identifier
- test_date: the date of the exam
- day_order: the ordinary number of the exam in the day. For example, if two exams were taken on the same date, the first gets day_order == 1 and the second gets day_order == 2
- week: the ordinary number of the week
- n_week: number of exams in the week
- n_day: number of exams in the day
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long id int test_date float(day_order week n_week n_day) 1 16560 1 283 2 1 1 16579 1 286 2 2 1 16589 1 287 2 1 1 16589 2 287 1 1 1 16602 1 289 1 1 1 16615 1 291 1 2 1 16618 1 291 2 1 4 15465 1 127 3 1 4 15467 1 127 1 1 4 15467 2 127 1 2 4 15481 1 129 3 1 4 15494 1 131 1 1 4 15500 1 132 3 1 4 15517 1 134 1 2 8 15833 1 179 3 1 8 15847 1 181 2 1 8 15858 1 183 2 1 8 15858 2 183 2 2 8 15864 1 184 2 2 8 15866 1 184 3 1 8 15871 1 185 1 2 8 15873 1 185 3 1 8 15873 2 185 2 1 8 15878 1 186 1 2 8 15882 1 186 2 1 end format %td test_date
I'd appreciate your help!
Comment