How to account for participants in a study design? I have a conceptual problem.
I want to find out if stress during the day leads to (stronger) teeth grinding (bruxism) at night. I have a number of participants. They will fill in a self-report questionnaire rating their level of stress during the day. During the night, the durating and strength of their teeth grinding are measured electronically. Each participant will do this on a number of consecutive days. As a result I will have data in this form:
participant  stress_day_1  bruxism_night_1  stress_day_2  bruxism_night_2
1            5             8                1             3
...

What I'm usure about is wether I should take all the stress/bruxism value pairs and do my analysis on them, disregarding the fact that they come from different patients, or if I should calculate means for each patient and do my analysis on these means, or something else entirely.
My variables are stress and bruxism, but I'm confused as to what place the participants should have in my analysis. I only have three nights, so cannot do a time series analysis.
I would greatly appreciate any feedback.
Also, please edit the tags as you see fit. I wasn't sure which ones to choose.
 A: I guess the standard way of doing this is by using linear mixed models. This way you can evaulate the effect of (self reported) stress on bruxism, accounting for the fact that the data come from the same participants.
Have a look at the very good (and short, and accessible) tutorials by Bodo Winter:

*

*Linear models and linear mixed effects models in R: Tutorial 1 (PDF),

*A very basic tutorial for performing linear mixed effects analyses (Tutorial 2) (PDF).

A: If I understand your question well, then you want to estimate a regression $y=\beta_1 x + \beta_2$, where (a) $x$ is stress during the day and $y$ is grinding, and (b) you think that at least one of the coefficients could be dependent on the participant, in other words your model is more like $y=\beta_1^{(p)} x + \beta_2^{(p)}$ where the superscript $(p)$ indicates that the coefficient can change from participant to participant.  
Let us for simplicity assume that the constant changes from participant to participant but not the slope (but the technique decribed below also works if both are depedent on the patient), so your model is: $y=\beta_1 x + \beta_2^{(p)}$.  If the number of participants is limited, then you might introcuce a dummy for the participants, but that inflates the number of parameters to estimate.  
A better idea is to introduce a so-called 'random intercept' (see e.g. Fitzmaurice, Laird, Ware, "Applied Longitudinal Analysis"), in that case you assume that the intercept is different for each participant, but the distribution of the intercepts for all participants is normal with a certain mean and a certain standard deviation.  If you do this then you limit the number of parameters to estimate to (a) the mean of the random intercept, (b) the standard deviation of the random intercept and (c) the slope, while if you dummy encoding for the participants you will have to esimate $N$ (the number of participant) minus one dummies and the slope. 
In R you can use the package nlme for this and with the above notations ($x$ is stress, $y$ is grinding) and there is a random intercept you have the syntax 
lme(y  ~ x + 1, 
    random= ~ 1|participant, 
    data=myData, 
    method="REML")

where your dataset has the structure has four columns: y (grinding), x (stress), day, participant, so you use one line for each day. 
