Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add effects and ANOVAtest function for lm #70

Closed
wants to merge 2 commits into from
Closed

add effects and ANOVAtest function for lm #70

wants to merge 2 commits into from

Commits on May 16, 2014

  1. add effects and ANOVA test

    the effects function extracts the effects from an LmMod either produced with a formula and dataframe or from LmMod produced using a y and X matrix.  ANOVA test allows you to specify terms in an LmMod model to do an anova (full vs reduced) test.  You can specify 1 or more terms if the model was produced with a formula and data frame.  If the LmMod was produced with a y and X, you can specify the columns of X that you would like to group together.  ANOVAtest is a type to hold DF,SS,MS,F, and either the pval or -log10pval.  It has a show function that produces a table.  Below are some examples.
    
    a=randn(100,4);
    b=convert(DataFrame,a);
    
    c=fit(LmMod,x1~x2+x3+x4,b)   #fit model with formula and dataframe
    d=ANOVAtest(c,[2,3],log10pval=true)  #test of multiple columns of X with LmMod made with formula and dataframe
    e=ANOVAtest(c,3)     #test of a single column of X with LmMod made with formula and dataframe
    f=ANOVAtest(c,[3])    #shows that you can also do one term with a single cell array
    
    g=fit(LmMod,c.model.pp.X,c.model.rr.y)   #fit model with X and y without formula or dataframe
    h=ANOVAtest(g,[3,4])  #test of multiple columns of X with LmMod made without formula and dataframe
    i=ANOVAtest(g,4)   #test of a single column of X with LmMod made without formula and dataframe
    j=ANOVAtest(g,[4])    #shows that you can also do one term was a single cell array
    timema committed May 16, 2014
    Copy the full SHA
    8cc97bb View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    0c6c2bd View commit details
    Browse the repository at this point in the history