Have a table with three prompts per date and want to split it up

조회 수: 2 (최근 30일)
BA
BA 2022년 7월 6일
댓글: Cris LaPierre 2022년 7월 7일
I have survey data from a table that was sent three times per day so a subject could have anywhere between 1 and 3 responses per day. The issue is that all of these dates are within the same column and I'd like to split it up into three different columns. For the dates
Here is a sample of the data. If you have any advice, please let me know! Thanks
Ideally, this is how I would want it to become.
  댓글 수: 1
dpb
dpb 2022년 7월 6일
I would venture it's probably not needed to split the data physically and, in fact, will be harder to analyze/process/code if do, than don't.
Use grouping variable(s) and the various splitapply workflow tools -- with a timetable there are a number of other builtin tools as well...

댓글을 달려면 로그인하십시오.

채택된 답변

Cris LaPierre
Cris LaPierre 2022년 7월 6일
I would look into stack and unstack functions. Share your data, and we might be able to provide more help. You can save it to a mat file and attach it using the paperclip icon.
  댓글 수: 2
BA
BA 2022년 7월 7일
편집: BA 2022년 7월 7일
i=[3:53];
Survey_Prompt_Unstack = unstack(Survey_Prompt, 3, i);
Thanks for mentioning the function to me. I'm unfortunately unable to figure out a way to get it to work with my data set. I have attached the data. Each time I try to run the command above, I get this message:
%Error using tabular/unstack
%The indicator variable must be specified as a single variable.
Cris LaPierre
Cris LaPierre 2022년 7월 7일
The way your data has been collected, there is no simple way to do this. Do you have any additional details that could be used to identify/discern between the 3 surveys? Also note that there were 4 surveys on Aug 7.
Even something like a timestamp could be used for this purpose.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by