cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Rini_Kar
Level II

Counting the number of columns with specific value

Hi,

I have a data table with columns (around 60) representing the different question code and rows respresenting individual student id and their corresponding scores obtained for each questions. Each student was given a different set of booklets with different questions. The scores given for each question is either 0 (no credit) or 1(partial credit) or 2(full credit) and missing values for those question which a student did not get in his/her booklet. I would like to get the count of questions for which the score was not a missing value and > 0 (ie.,1 and 2) in a new column.  Below is my sample data table.

CNTSCHIDCNTSTUIDGENDERL6 - M00GQ01SL2 - M033Q01SL4 - M034Q01SL3 - M155Q02CL5 - M155Q03C
7020000170205783Male01010
7020000170205411Female10.11
7020000170205421Male1.021
7020000170201886Female1020.
7020000170206437Female11221


Thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Counting the number of columns with specific value

To do this interactively I would do the following:

1.  Go to 

           Tables==>Stack

2. Select all of the response columns as columns to be stacked. 

3. Click on OK

4. In the newly created data table, go to the column named "Data" and find a cell with a "0" value.

5. Click on that cell to select it.

6. You indicated that you did not want to have any zero values counted, so now right click on the selected cell, and select "Select Matching Cells".

7. Go to the pull down menu "Rows", click on it and select "Delete Rows"

( You could repeat the same steps for the rows that have missing values, but since missing values are egnored by JMP platforms, it isn't necessary.)

8. Now to count the values, go to

       Tables==>Summary

9. Select the column named "Data" for the statistic column, selecting "N" as the statistic to be calculated.

10. Select the column named "CNTSTUID" and place it in the Group selection box.

11. Click on "OK"

 

The new data table will give you a count for each student for the number of questions with responses greater than zero.

 

 

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Counting the number of columns with specific value

To do this interactively I would do the following:

1.  Go to 

           Tables==>Stack

2. Select all of the response columns as columns to be stacked. 

3. Click on OK

4. In the newly created data table, go to the column named "Data" and find a cell with a "0" value.

5. Click on that cell to select it.

6. You indicated that you did not want to have any zero values counted, so now right click on the selected cell, and select "Select Matching Cells".

7. Go to the pull down menu "Rows", click on it and select "Delete Rows"

( You could repeat the same steps for the rows that have missing values, but since missing values are egnored by JMP platforms, it isn't necessary.)

8. Now to count the values, go to

       Tables==>Summary

9. Select the column named "Data" for the statistic column, selecting "N" as the statistic to be calculated.

10. Select the column named "CNTSTUID" and place it in the Group selection box.

11. Click on "OK"

 

The new data table will give you a count for each student for the number of questions with responses greater than zero.

 

 

Jim
Rini_Kar
Level II

Re: Counting the number of columns with specific value

Thanks Jim. The solution is working perfectly with my data set