Hi,
I'm getting stuck on what I suspect is a small point and couldn't find the solution. I would like to conduct a single-group interrupted time series analysis using Linden's itsa package using the data copied at bottom.
The intervention is at time point 31.
This generates the following error:
Clearly my knowledge of time series data is lacking, but I can't seem to get this to work.
I'm using 'itsa' from SSC in Stata 17.0.
Thanks.
Owen
I'm getting stuck on what I suspect is a small point and couldn't find the solution. I would like to conduct a single-group interrupted time series analysis using Linden's itsa package using the data copied at bottom.
The intervention is at time point 31.
Code:
tsset id obsday itsa sleep, single trperiod(31) lag(1) posttrend figure
Code:
d(31) invalid r(198);
I'm using 'itsa' from SSC in Stata 17.0.
Thanks.
Owen
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(id group obsday sleep) 1 1 1 353 1 1 9 345 1 1 15 340 1 1 21 337 1 1 26 324 1 1 33 332 1 1 41 326 1 1 49 329 2 1 1 362 2 1 9 361 2 1 15 355 2 1 23 365 2 1 28 350 2 1 33 343 2 1 39 333 2 1 45 320 3 1 1 345 3 1 9 360 3 1 16 347 3 1 24 348 3 1 29 351 3 1 37 348 3 1 44 334 3 1 50 335 4 1 1 338 4 1 9 357 4 1 16 384 4 1 21 418 4 1 26 408 4 1 31 404 4 1 36 423 4 1 43 403 5 1 1 341 5 1 8 341 5 1 15 356 5 1 21 368 5 1 27 377 5 1 33 367 5 1 40 363 5 1 46 362 6 1 1 353 6 1 8 340 6 1 15 334 6 1 22 330 6 1 28 327 6 1 35 306 6 1 41 321 6 1 49 319 7 1 1 373 7 1 7 373 7 1 13 380 7 1 21 377 7 1 27 372 7 1 31 372 7 1 38 361 7 1 45 347 8 1 1 323 8 1 7 327 8 1 12 335 8 1 19 307 8 1 25 314 8 1 32 284 8 1 40 244 8 1 47 235 9 1 1 353 9 1 7 361 9 1 13 350 9 1 19 342 9 1 25 317 9 1 30 301 9 1 36 306 9 1 43 303 10 1 1 365 10 1 8 366 10 1 14 368 10 1 21 374 10 1 27 396 10 1 34 369 10 1 39 393 10 1 47 391 11 1 1 343 11 1 7 347 11 1 14 334 11 1 20 327 11 1 25 326 11 1 33 312 11 1 38 348 11 1 45 356 12 1 1 360 12 1 8 356 12 1 14 342 12 1 20 360 12 1 26 366 12 1 32 350 12 1 38 383 12 1 45 385 13 1 1 347 13 1 8 353 13 1 12 339 13 1 18 316 end format %td obsday label values group group label def group 1 "Control", modify
Comment