Category Archives: Tutorials

Break, Continue and Pass statements using for loops in Python

In programming, for loops are used to automate repetitive tasks, such as analysing similar datasets from different subjects. Sometimes, a dataset might be slightly different to another such that the data can be used but needs to be analysed differently in the loop. For example, data might have been accidentally sampled at a higher rate, or a nested trial needs

Read more

R: How to reshape data from wide to long format, and back again

Many studies take repeated observations on subjects. For example, clinical trials record outcomes from subjects before and after treatments, and laboratory studies might record physiological outcomes from the same subjects over time. In a dataframe, when observations from each subject are written on one row and repeated observations are stored as different column variables, we say the data are in

Read more
« Older Entries