[R] t-test on a data-frame.

Sarah Goslee sarah.goslee at gmail.com
Thu Jul 14 14:31:08 CEST 2011


Hi Student (since you have no other name),

On Thu, Jul 14, 2011 at 6:42 AM, Economics Student
<economicsstudent2011 at gmail.com> wrote:
> Dear R-helpers,
>
> In a data frame I have 100 securities,monthly closing value,from 1995 to
> present,which I have to
>
> 1. Sampling with replacement,make 50 samples of 10 securities each,each
> sample hence will be a data frame with 10 columns.
> 2. With uniform probabilty,mark a month from 2000 onwards as a "special"
> month,t=0.
> 3. I have to subtract the market index from each column of each sample and
> then compute the residues.
> 4. For each data frame of residues I have to compute the statistic (  Eps i0
> - mean(Eps it )  ) / var( Eps it ). Here i and t vary over one particular
> data frame. i0 corresponds to ith security residue on the special month.
> Basically a t-test involving a frame instead of a vector.
> 5. Print out a table where the statistic is significant at the 1,5,10%
> level.
>
> Could someone give the broad ideas on doing this ?

Why yes. You should talk to your professor or TA. The list doesn't do
homework problems, though if you ask nicely we may help with the finer
points of R. And by "nicely," I don't mean saying please, though it
doesn't hurt. I mean providing reproducible examples, clear statements
of your problem, and signing your email professionally, with an actual
name.

Sarah
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list