Results 1 to 4 of 4

Thread: Performing calculation on section(s) of a package output

Threaded View

  1. #1
    TS Contributor
    Points: 12,467, Level: 73
    Level completed: 5%, Points required for next Level: 383
    gianmarco's Avatar
    Location
    Italy
    Posts
    726
    Thanks
    45
    Thanked 94 Times in 72 Posts

    Performing calculation on section(s) of a package output

    Hi Guys,
    I am working on writing a R's script for Correspondence Analysis.....Yes, @Trinker, I am talking about a R's script

    A number of packages are available to perform CA in R, and I am planning to pick the best from each one in order to provide users with a body of output statistics and graphs useful for CA interpretation.

    I am faced with some issues I did not managed to solve on my own, so I would appreciate to have some guidance by someone of goodwill

    The library is "ca" and the dataset coming with it is named "smoke".

    Code: 
    library(ca)
    data(smoke)
    summary(ca(smoke))
    The contingency table on which CA is performed is:
    none light medium heavy
    SM 4 2 3 2
    JM 4 3 7 4
    SE 25 10 12 4
    JE 18 24 33 13
    SC 10 6 7 2

    The summary of CA analsis is as follows:

    Principal inertias (eigenvalues):

    dim value % cum% scree plot
    1 0.074759 87.8 87.8 *************************
    2 0.010017 11.8 99.5 ***
    3 0.000414 0.5 100.0
    -------- -----
    Total: 0.085190 100.0


    Rows:
    name mass qlt inr k=1 cor ctr k=2 cor ctr
    1 | SM | 57 893 31 | -66 92 3 | -194 800 214 |
    2 | JM | 93 991 139 | 259 526 84 | -243 465 551 |
    3 | SE | 264 1000 450 | -381 999 512 | -11 1 3 |
    4 | JE | 456 1000 308 | 233 942 331 | 58 58 152 |
    5 | SC | 130 999 71 | -201 865 70 | 79 133 81 |

    Columns:
    name mass qlt inr k=1 cor ctr k=2 cor ctr
    1 | none | 316 1000 577 | -393 994 654 | -30 6 29 |
    2 | lght | 233 984 83 | 99 327 31 | 141 657 463 |
    3 | medm | 321 983 148 | 196 982 166 | 7 1 2 |
    4 | hevy | 130 995 192 | 294 684 150 | -198 310 506 |

    I have two (may be dumb) questions:

    1) how can I ask R to return me the mumber of rows and columns of the contingency table?

    2) how can I "extract" the values under the label "value" (highlighted in bold at the start of the CA summary above) in order to make some calculation on them: e.g., returning only the values that are greater than a given threshold.


    Any guidance on these issues is welcome.
    Thanks for your attention.

    Regards
    Gm

    p.s.
    sorry if the Thread's title is not so clear. On this respect, how the (package's) output appearing on the R console is actually named?
    Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read -Groucho Marx-

  2. The Following User Says Thank You to gianmarco For This Useful Post:

    trinker (07-09-2012)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats