Research Report: Analyzing Conditions for Enhanced Memory and Recall
VerifiedAdded on  2020/04/21
|11
|3127
|241
Report
AI Summary
This report investigates the conditions under which people exhibit better memory, addressing the research question: 'In what condition people have better memory?' The study utilizes a repeated measures ANOVA to analyze data collected from 100 individuals across four time periods. The research explores the impact of various factors, including physical exercise (running), listening to music, drinking red wine, and IQ level on memory performance. The analysis reveals that running outdoors while listening to music significantly impacts memory. The descriptive analysis shows that except for the IQ score all the other variable are categorical variables. The study also discusses the use of repeated measures ANOVA and its advantages, along with the limitations of the approach, and suggests avenues for future research, such as incorporating logistic regression analysis or exploring other factors that might influence memory. The findings align with previous research highlighting the positive effects of exercise on memory and concentration, emphasizing the importance of these factors in information retention and recall.

Chapter: 1 In what conditions people have better memory
Contents
Chapter: 1 Conditions to have better memory......................................................................................1
1.1 Introduction and Background......................................................................................................1
1.2 Methods and Materials.................................................................................................................3
1.2.1 Data collection and sample size...........................................................................................3
1.2.2 Variables included in the data set.........................................................................................3
1.2.3 Data analysis procedure.......................................................................................................4
1.3 Results and Discussions...............................................................................................................4
1.4 Discussion and Summary.............................................................................................................7
References...............................................................................................................................................7
References...............................................................................................................................................8
1.1 Introduction and Background
In the 21st century people have access to large amount of information everyday and retaining
useful information has become one major problem. When there is lots of information one has to
be selective and the priority of the collected information should be set so that the important and
useful information can be recalled when required (Friedman, McGillivray, Murayama, & Castel,
2015). Memory plays an important role in storing the information and recalling later. Some of
Contents
Chapter: 1 Conditions to have better memory......................................................................................1
1.1 Introduction and Background......................................................................................................1
1.2 Methods and Materials.................................................................................................................3
1.2.1 Data collection and sample size...........................................................................................3
1.2.2 Variables included in the data set.........................................................................................3
1.2.3 Data analysis procedure.......................................................................................................4
1.3 Results and Discussions...............................................................................................................4
1.4 Discussion and Summary.............................................................................................................7
References...............................................................................................................................................7
References...............................................................................................................................................8
1.1 Introduction and Background
In the 21st century people have access to large amount of information everyday and retaining
useful information has become one major problem. When there is lots of information one has to
be selective and the priority of the collected information should be set so that the important and
useful information can be recalled when required (Friedman, McGillivray, Murayama, & Castel,
2015). Memory plays an important role in storing the information and recalling later. Some of
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

the scholars have compared the human memory with the computer system also which is known
as the information processing model. In this process there are three steps through which the
information goes namely the encoding, storage and retrieval. Memory is mainly related to the
third stage i.e retrieval (Benjamin, 2012; Friedman et al., 2015).
Since memory plays an important role not only for the students but also in every stage of human
life the current research has been conducted to find the conditions where the memory is better. In
other words the current research is aimed to answer following research question:
a) In what condition people have better memory?
b) Does physical exercise, drinking habit, IQ level have significant impact on memory?
To answer these research questions the repeated measure techniques has been used. The repeated
measure techniques were developed to study the difference in the same participant over the
period of time. In other words, as the name suggests the repeated measure is used when the data
is collected from the same respondents in different time period. It analyze whether there is
significant difference in different time period(Field, 2011).
The main advantage of using repeated measure technique is that it allows the researcher to record
the change in an individual over the period of time, which is not possible in the cross sectional
studies. In cross sectional records are collected at only point of time. Apart from that the
repeated measure method is better statistical tool to detect the change over the period of time
with less cost(Guo, Logan, Glueck, & Muller, 2013).
Previous scholars have also used repeated measure tool in their study. A study by (Cleophas,
Zwinderman, & Ouwerkerk, 2009) use the repeated measure technique to analyze the
cardionvascular. Authors used paired t-test , Analysis of variance (ANOVA) for repeated
measure to analyze the collected data. Another study by (Singh, Rana, & Singhal, 2013) used
the repeated measure technique for analyzing the clinical trials data. The data was collected in
two different time period and repeated time ANOVA analysis was used to get the results as the
simple ANOVA is not appropriate for the data with repeated measure. Similarly (Kim, 2015)
used the one way ANOVA in repeated measure technique to find the impact of some particular
treatment under clinical trials. So this shows that the repeated measure technique is popular in
medical research, however latterly it has been used in social science research also.
as the information processing model. In this process there are three steps through which the
information goes namely the encoding, storage and retrieval. Memory is mainly related to the
third stage i.e retrieval (Benjamin, 2012; Friedman et al., 2015).
Since memory plays an important role not only for the students but also in every stage of human
life the current research has been conducted to find the conditions where the memory is better. In
other words the current research is aimed to answer following research question:
a) In what condition people have better memory?
b) Does physical exercise, drinking habit, IQ level have significant impact on memory?
To answer these research questions the repeated measure techniques has been used. The repeated
measure techniques were developed to study the difference in the same participant over the
period of time. In other words, as the name suggests the repeated measure is used when the data
is collected from the same respondents in different time period. It analyze whether there is
significant difference in different time period(Field, 2011).
The main advantage of using repeated measure technique is that it allows the researcher to record
the change in an individual over the period of time, which is not possible in the cross sectional
studies. In cross sectional records are collected at only point of time. Apart from that the
repeated measure method is better statistical tool to detect the change over the period of time
with less cost(Guo, Logan, Glueck, & Muller, 2013).
Previous scholars have also used repeated measure tool in their study. A study by (Cleophas,
Zwinderman, & Ouwerkerk, 2009) use the repeated measure technique to analyze the
cardionvascular. Authors used paired t-test , Analysis of variance (ANOVA) for repeated
measure to analyze the collected data. Another study by (Singh, Rana, & Singhal, 2013) used
the repeated measure technique for analyzing the clinical trials data. The data was collected in
two different time period and repeated time ANOVA analysis was used to get the results as the
simple ANOVA is not appropriate for the data with repeated measure. Similarly (Kim, 2015)
used the one way ANOVA in repeated measure technique to find the impact of some particular
treatment under clinical trials. So this shows that the repeated measure technique is popular in
medical research, however latterly it has been used in social science research also.

1.2 Methods and Materials
1.2.1 Data collection and sample size
The current research is aimed to find the condition where the individual has better memory. For
the analysis purpose primary data was collected among 100 individuals in four different time
period. So the total number of observation is 2500. The close ended questionnaire was used to
collect the data and respondents were chosen randomly. In case of random sampling each and
every element in the data set has equal probably of being selected in the sample and the random
sampling is considered to be the better sampling techniques as compared to the non-random
sampling for repeated measure analysis. Prior collecting the final data, a pilot study was
conducted among 25 respondents and the reliability was tested. The results from the reliability
showed satisfactory results, after that the final survey was conducted. Same respondents were
taken into survey in four different time period. Since the repeated measure techniques has been
identified as the best technique to use for such analysis the data was collected accordingly. In
terms of demographic profile, all the respondents were in the age group of 25 to 45. This is
because the individual in the younger age and older age may not take the memory test properly.
Also the responses have minimum level of education and they are able to read and understand
the questions included in the questionnaire (Shukla & Kumar, 2012).
1.2.2 Variables included in the data set
For the current research different factors were taken into consideration. The list of the variables
included in the current study is as follows:
1) Happy memories – it takes the value 1 if applicable to the individual and 0 if not
applicable on the individual
2) Listen music – It takes the value 1 if the respondents listen to music and 0 if the
respondents do not listen to music
3) Outside running – It takes the value 1 if the respondents go for running outside and 0 if
the respondents do not go for running.
4) Drink red wine – It takes the value 1 if the respondent drinks red wine and 0 if the
respondents do not drink red wine
1.2.1 Data collection and sample size
The current research is aimed to find the condition where the individual has better memory. For
the analysis purpose primary data was collected among 100 individuals in four different time
period. So the total number of observation is 2500. The close ended questionnaire was used to
collect the data and respondents were chosen randomly. In case of random sampling each and
every element in the data set has equal probably of being selected in the sample and the random
sampling is considered to be the better sampling techniques as compared to the non-random
sampling for repeated measure analysis. Prior collecting the final data, a pilot study was
conducted among 25 respondents and the reliability was tested. The results from the reliability
showed satisfactory results, after that the final survey was conducted. Same respondents were
taken into survey in four different time period. Since the repeated measure techniques has been
identified as the best technique to use for such analysis the data was collected accordingly. In
terms of demographic profile, all the respondents were in the age group of 25 to 45. This is
because the individual in the younger age and older age may not take the memory test properly.
Also the responses have minimum level of education and they are able to read and understand
the questions included in the questionnaire (Shukla & Kumar, 2012).
1.2.2 Variables included in the data set
For the current research different factors were taken into consideration. The list of the variables
included in the current study is as follows:
1) Happy memories – it takes the value 1 if applicable to the individual and 0 if not
applicable on the individual
2) Listen music – It takes the value 1 if the respondents listen to music and 0 if the
respondents do not listen to music
3) Outside running – It takes the value 1 if the respondents go for running outside and 0 if
the respondents do not go for running.
4) Drink red wine – It takes the value 1 if the respondent drinks red wine and 0 if the
respondents do not drink red wine
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

5) IQ – It is the IQ score of the respondent.
1.2.3 Data analysis procedure
For the analysis purpose the repeated measure ANOVA analysis was performed. First the
primary data was imported in R from the excel sheet using the read.csv command in R. The one
row per observation method was followed to import the data into long form. The wide is more
appropriate if there is large number of variables and less observations. Prior conducting the
ANOVA the conditional means was extracted for every individual and each combination of
factors used in the study. After the conditional mean the repeated measure ANOVA was
performed to see whether the respondents have better memory after taking consideration
different factor such as the running, listening music, drinking red wine and IQ score. If the
memory improve over the period of time it can be concluded that the factors have significant on
the memory improving. Results from the analysis are discussed in the next section.
1.3 Results
The main aim of the current research is to find the impact of the various factors on better
memory. With the help of repeated measure technique it was identified where the person have
better memory. Two way ANOVA was used to find whether there is significant impact on the
memory, before and after some activity.
Descriptive analysis
vars n mean sd median trimmed mad min max range skew
Happy_mem 1 2500 0.50 0.50 0.50 0.50 0.74 0.00 1.00 1.00 0.0
drink.redwine 2 2500 0.54 0.50 1.00 0.55 0.00 0.00 1.00 1.00 -0.1
run.outdoo 3 2500 0.49 0.50 0.00 0.49 0.00 0.00 1.00 1.00 0.0
1.2.3 Data analysis procedure
For the analysis purpose the repeated measure ANOVA analysis was performed. First the
primary data was imported in R from the excel sheet using the read.csv command in R. The one
row per observation method was followed to import the data into long form. The wide is more
appropriate if there is large number of variables and less observations. Prior conducting the
ANOVA the conditional means was extracted for every individual and each combination of
factors used in the study. After the conditional mean the repeated measure ANOVA was
performed to see whether the respondents have better memory after taking consideration
different factor such as the running, listening music, drinking red wine and IQ score. If the
memory improve over the period of time it can be concluded that the factors have significant on
the memory improving. Results from the analysis are discussed in the next section.
1.3 Results
The main aim of the current research is to find the impact of the various factors on better
memory. With the help of repeated measure technique it was identified where the person have
better memory. Two way ANOVA was used to find whether there is significant impact on the
memory, before and after some activity.
Descriptive analysis
vars n mean sd median trimmed mad min max range skew
Happy_mem 1 2500 0.50 0.50 0.50 0.50 0.74 0.00 1.00 1.00 0.0
drink.redwine 2 2500 0.54 0.50 1.00 0.55 0.00 0.00 1.00 1.00 -0.1
run.outdoo 3 2500 0.49 0.50 0.00 0.49 0.00 0.00 1.00 1.00 0.0
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

listen_music 4 2500 0.50 0.50 0.50 0.50 0.74 0.00 1.00 1.00 0.0
IQ 5 2500 68.63 5.01 69.27 68.67 4.03 57.59 79.67 22.08 -0.1
target 6 2500 0.41 0.49 0.00 0.39 0.00 0.00 1.00 1.00 0.3
pid 7 2500 13.00 7.21 13.00 13.00 8.90 1.00 25.00 24.00 0.0
Table 1 Descriptive analysis for the variables in the data set
Results from the descriptive analysis show that the except for the IQ score all the other variable
are categorical variables. In fact all the variables are binary, which takes only the value 0 or 1. In
case of IQ test which is the only continuous variable in the data set shows that the average IQ
score of the respondents included in the sample is 68.63. The minimum score is 57. 59 whereas
the maximum IQ score is 79.67. This indicates that the data is normally distributed as most of the
observations are near the mean value.
Repeated measures using tow way ANOVA
Results from the repeated measure ANOVA is shown in the tables below. Impact of the each
factors and their interaction is shown separately. Since the data was collected for the different
time period it is important to include the error term in the analysis which will take into
consideration the natural variation from one respondents to another participants.
Error: pid
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.762 0.7618 3.003 0.0978 .
## listen_music 1 0.412 0.4118 1.623 0.2165
## run.outdoor:listen_music 1 0.184 0.1842 0.726 0.4037
## Residuals 21 5.327 0.2537
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Table 2 ANOVA results for repeated measure in R
As shown in the table above listening to music is not significant as the p value is more than 0.05.
Similarly running outdoor is significant only at 10 % as the F value shows p value of 0.09. So it
can be said that the running outdoor helps to improve memory. However the interaction between
running outdoor and listening music is again insignificant.
IQ 5 2500 68.63 5.01 69.27 68.67 4.03 57.59 79.67 22.08 -0.1
target 6 2500 0.41 0.49 0.00 0.39 0.00 0.00 1.00 1.00 0.3
pid 7 2500 13.00 7.21 13.00 13.00 8.90 1.00 25.00 24.00 0.0
Table 1 Descriptive analysis for the variables in the data set
Results from the descriptive analysis show that the except for the IQ score all the other variable
are categorical variables. In fact all the variables are binary, which takes only the value 0 or 1. In
case of IQ test which is the only continuous variable in the data set shows that the average IQ
score of the respondents included in the sample is 68.63. The minimum score is 57. 59 whereas
the maximum IQ score is 79.67. This indicates that the data is normally distributed as most of the
observations are near the mean value.
Repeated measures using tow way ANOVA
Results from the repeated measure ANOVA is shown in the tables below. Impact of the each
factors and their interaction is shown separately. Since the data was collected for the different
time period it is important to include the error term in the analysis which will take into
consideration the natural variation from one respondents to another participants.
Error: pid
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.762 0.7618 3.003 0.0978 .
## listen_music 1 0.412 0.4118 1.623 0.2165
## run.outdoor:listen_music 1 0.184 0.1842 0.726 0.4037
## Residuals 21 5.327 0.2537
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Table 2 ANOVA results for repeated measure in R
As shown in the table above listening to music is not significant as the p value is more than 0.05.
Similarly running outdoor is significant only at 10 % as the F value shows p value of 0.09. So it
can be said that the running outdoor helps to improve memory. However the interaction between
running outdoor and listening music is again insignificant.

Error: pid:run.outdoor
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.007 0.0066 0.025 0.877
## listen_music 1 0.014 0.0140 0.052 0.823
## run.outdoor:listen_music 1 1.934 1.9341 7.146 0.015 *
## Residuals 19 5.143 0.2707
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Table 3 ANOVA results for repeated measure in R
On the other hand when the running outdoor was controlled for the error the interaction between
the running outdoor and listening music is significant at 5 %. On the basis of this it can be said
that running outside while listening to music leads to better memory.
Error: pid:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## listen_music 1 0.212 0.2123 1.050 0.321
## run.outdoor:listen_music 1 0.051 0.0510 0.252 0.622
## Residuals 16 3.237 0.2023
Table 4 ANOVA results for repeated measure in R
Furthermore when the listen music variable was control for the error term, none of the variables
show significant results as the p for listen music and the interaction between running outdoor and
listen music is greater than 0.05.
Error: pid:run.outdoor:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor:listen_music 1 0.75 0.75 3 0.225
## Residuals 2 0.50 0.25
##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 24 3.625 0.151
Table 5 ANOVA results for repeated measure in R
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.007 0.0066 0.025 0.877
## listen_music 1 0.014 0.0140 0.052 0.823
## run.outdoor:listen_music 1 1.934 1.9341 7.146 0.015 *
## Residuals 19 5.143 0.2707
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Table 3 ANOVA results for repeated measure in R
On the other hand when the running outdoor was controlled for the error the interaction between
the running outdoor and listening music is significant at 5 %. On the basis of this it can be said
that running outside while listening to music leads to better memory.
Error: pid:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## listen_music 1 0.212 0.2123 1.050 0.321
## run.outdoor:listen_music 1 0.051 0.0510 0.252 0.622
## Residuals 16 3.237 0.2023
Table 4 ANOVA results for repeated measure in R
Furthermore when the listen music variable was control for the error term, none of the variables
show significant results as the p for listen music and the interaction between running outdoor and
listen music is greater than 0.05.
Error: pid:run.outdoor:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor:listen_music 1 0.75 0.75 3 0.225
## Residuals 2 0.50 0.25
##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 24 3.625 0.151
Table 5 ANOVA results for repeated measure in R
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

As shown in the results when the interaction of running outside and listen music were controlled,
the variable is insignificant indicating that there is no effect on memory.
1.4 Discussion and Summary
For the current research the repeated measure ANOVA was used for the analysis and the results
shows that running outside, while listening to music show significant impact on the memory. It
has been shown in the previous research also that exercise has significant on memory; the results
from current study are in line with the previous one. Running helps to concentrate which may be
reason that running has significant impact to have better memory. With increase in concentration
individuals are able to retain the important information and recall when required.
Apart from the repeated measure ANOVA one can also use the logistic regression to see the
impact of different factors on memory. Some of the previous researchers have used logistic
regression analysis for same purpose and got similar results. So, one can used either logistic
regression or repeated measure ANOVA for the data collected in different time period. One
problem with the repeated measure is when the error model comes out to be singular. There are
different methods to overcome singular problem which can be further explored. Similarly further
research can be conducted taking into consideration some other factors which can lead to better
memory. Similarly one can perform both the logistic regression and repeated measure techniques
for the same data set and compare the results.
References
Benjamin, A. S. (2012). Factors influencing learning. Illinois.
Cleophas, T. J., Zwinderman, A. H., & Ouwerkerk, B. M. van. (2009). Methods for analysing
cardiovascular studies with repeated measures. NCBI, 17(11).
Field, A. (2011). Discovering Statistics Using SPSS (3rd ed.). California: SAGE Publication.
Friedman, M. C., McGillivray, S., Murayama, K., & Castel, A. D. (2015). Memory for
Medication Side Effects in Younger and Older Adults: The Role of Subjective and Objective
Importance. California.
Guo, Y., Logan, H. L., Glueck, D. H., & Muller, K. E. (2013). Selecting a sample size for studies
with repeated measures. NCBI, 13(3).
the variable is insignificant indicating that there is no effect on memory.
1.4 Discussion and Summary
For the current research the repeated measure ANOVA was used for the analysis and the results
shows that running outside, while listening to music show significant impact on the memory. It
has been shown in the previous research also that exercise has significant on memory; the results
from current study are in line with the previous one. Running helps to concentrate which may be
reason that running has significant impact to have better memory. With increase in concentration
individuals are able to retain the important information and recall when required.
Apart from the repeated measure ANOVA one can also use the logistic regression to see the
impact of different factors on memory. Some of the previous researchers have used logistic
regression analysis for same purpose and got similar results. So, one can used either logistic
regression or repeated measure ANOVA for the data collected in different time period. One
problem with the repeated measure is when the error model comes out to be singular. There are
different methods to overcome singular problem which can be further explored. Similarly further
research can be conducted taking into consideration some other factors which can lead to better
memory. Similarly one can perform both the logistic regression and repeated measure techniques
for the same data set and compare the results.
References
Benjamin, A. S. (2012). Factors influencing learning. Illinois.
Cleophas, T. J., Zwinderman, A. H., & Ouwerkerk, B. M. van. (2009). Methods for analysing
cardiovascular studies with repeated measures. NCBI, 17(11).
Field, A. (2011). Discovering Statistics Using SPSS (3rd ed.). California: SAGE Publication.
Friedman, M. C., McGillivray, S., Murayama, K., & Castel, A. D. (2015). Memory for
Medication Side Effects in Younger and Older Adults: The Role of Subjective and Objective
Importance. California.
Guo, Y., Logan, H. L., Glueck, D. H., & Muller, K. E. (2013). Selecting a sample size for studies
with repeated measures. NCBI, 13(3).
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Kim, H.-Y. (2015). Statistical notes for clinical researchers: A one-way repeated measures
ANOVA for data with repeated observations. Restorative Dentistry & Endodontics, 40(1).
Shukla, G., & Kumar, V. (2012). Different Methods Of Analyzing Multiple Samples Repeated
Measures Data. Journal of Reliability and Statistical Studies, 5(1), 83–93.
Singh, V., Rana, R. K., & Singhal, R. (2013). Analysis of repeated measurement data in the
clinical trials. NCBI, 4(2).
Appendix
#creating the sample data
mydata <- data.frame(Happy_mem=sample(x=c(1,0),size=100, replace = T),
drink.redwine=sample(x=c(1,0),size=100,replace=T),
run.outdoo=sample(x=c(1,0), size=100, replace=T),
listen_music=sample(x=c(1,0),size=100, replace=T),
IQ=rnorm(50,sd = 5,mean = 70),
target=sample(x=c(1,0),size=100, replace=T),
pid=rep(seq(from=1, to=25, by=1),100)
)
#pid =25 means we have 4( 25*4=100) set of students with different treatment
applied
View(head(mydata))
dim(mydata)
## [1] 2500 7
#changing the categorical variable as factors
ANOVA for data with repeated observations. Restorative Dentistry & Endodontics, 40(1).
Shukla, G., & Kumar, V. (2012). Different Methods Of Analyzing Multiple Samples Repeated
Measures Data. Journal of Reliability and Statistical Studies, 5(1), 83–93.
Singh, V., Rana, R. K., & Singhal, R. (2013). Analysis of repeated measurement data in the
clinical trials. NCBI, 4(2).
Appendix
#creating the sample data
mydata <- data.frame(Happy_mem=sample(x=c(1,0),size=100, replace = T),
drink.redwine=sample(x=c(1,0),size=100,replace=T),
run.outdoo=sample(x=c(1,0), size=100, replace=T),
listen_music=sample(x=c(1,0),size=100, replace=T),
IQ=rnorm(50,sd = 5,mean = 70),
target=sample(x=c(1,0),size=100, replace=T),
pid=rep(seq(from=1, to=25, by=1),100)
)
#pid =25 means we have 4( 25*4=100) set of students with different treatment
applied
View(head(mydata))
dim(mydata)
## [1] 2500 7
#changing the categorical variable as factors

mydata <- within(mydata, {
Happy_mem <- factor(Happy_mem)
drink.redwine <- factor(drink.redwine)
run.outdoo <- factor(run.outdoo)
listen_music <- factor(listen_music)
pid=factor(pid)
})
myData <- mydata
#So we see that we have one row per observation per participant.
#Extracting conditional mean
myData.mean <- aggregate(mydata$target,
by = list(myData$Happy_mem, myData$drink.redwine,
myData$run.outdoo,myData$listen_music,
myData$pid),
FUN = mean)
colnames(myData.mean)<- c("Happy_mem", "drink.redwine", "run.outdoor",
"listen_music","pid", "memory")
myData.mean <- myData.mean[order(myData.mean$pid), ]
#head(myData.mean)
#So now we've gone from one row per participant per observation to one row per
participant per condition.
memory.aov <- with(myData.mean,
aov(memory ~
run.outdoor *
listen_music +
Happy_mem <- factor(Happy_mem)
drink.redwine <- factor(drink.redwine)
run.outdoo <- factor(run.outdoo)
listen_music <- factor(listen_music)
pid=factor(pid)
})
myData <- mydata
#So we see that we have one row per observation per participant.
#Extracting conditional mean
myData.mean <- aggregate(mydata$target,
by = list(myData$Happy_mem, myData$drink.redwine,
myData$run.outdoo,myData$listen_music,
myData$pid),
FUN = mean)
colnames(myData.mean)<- c("Happy_mem", "drink.redwine", "run.outdoor",
"listen_music","pid", "memory")
myData.mean <- myData.mean[order(myData.mean$pid), ]
#head(myData.mean)
#So now we've gone from one row per participant per observation to one row per
participant per condition.
memory.aov <- with(myData.mean,
aov(memory ~
run.outdoor *
listen_music +
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Error(pid/(run.outdoor*listen_music))))
## Warning in aov(memory ~ run.outdoor * listen_music + Error(pid/(run.outdoor
## * : Error() model is singular
summary(memory.aov)
##
## Error: pid
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.762 0.7618 3.003 0.0978 .
## listen_music 1 0.412 0.4118 1.623 0.2165
## run.outdoor:listen_music 1 0.184 0.1842 0.726 0.4037
## Residuals 21 5.327 0.2537
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Error: pid:run.outdoor
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.007 0.0066 0.025 0.877
## listen_music 1 0.014 0.0140 0.052 0.823
## run.outdoor:listen_music 1 1.934 1.9341 7.146 0.015 *
## Residuals 19 5.143 0.2707
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Error: pid:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## listen_music 1 0.212 0.2123 1.050 0.321
## run.outdoor:listen_music 1 0.051 0.0510 0.252 0.622
## Residuals 16 3.237 0.2023
##
## Error: pid:run.outdoor:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor:listen_music 1 0.75 0.75 3 0.225
## Residuals 2 0.50 0.25
## Warning in aov(memory ~ run.outdoor * listen_music + Error(pid/(run.outdoor
## * : Error() model is singular
summary(memory.aov)
##
## Error: pid
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.762 0.7618 3.003 0.0978 .
## listen_music 1 0.412 0.4118 1.623 0.2165
## run.outdoor:listen_music 1 0.184 0.1842 0.726 0.4037
## Residuals 21 5.327 0.2537
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Error: pid:run.outdoor
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor 1 0.007 0.0066 0.025 0.877
## listen_music 1 0.014 0.0140 0.052 0.823
## run.outdoor:listen_music 1 1.934 1.9341 7.146 0.015 *
## Residuals 19 5.143 0.2707
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Error: pid:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## listen_music 1 0.212 0.2123 1.050 0.321
## run.outdoor:listen_music 1 0.051 0.0510 0.252 0.622
## Residuals 16 3.237 0.2023
##
## Error: pid:run.outdoor:listen_music
## Df Sum Sq Mean Sq F value Pr(>F)
## run.outdoor:listen_music 1 0.75 0.75 3 0.225
## Residuals 2 0.50 0.25
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 24 3.625 0.151
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 24 3.625 0.151
1 out of 11
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
 +13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.





