Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have a panel dataset (denoted as fidata ) including 5000 firms (with an identifier of ticker ), and for each firm, there are 30
I have a panel dataset (denoted as fidata) including 5000 firms (with an identifier of ticker), and for each firm, there are 30 years (time variable is denoted by year) of observations of variable X. I would like to calculate the median of the X variable of these years in each firm. Which code below can help me achieve this purpose?
a.
apply(fidata$X, median)
b.
aggregate(.~year, data=fidata, median)
c.
median(fidata$X)
d.
aggregate (.~ticker, data=fidata, median)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started