Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: help with NaN removal from dataset class using group mean value
Replies: 3   Last Post: Jul 15, 2013 8:22 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Shatrughan

Posts: 18
Registered: 3/17/11
help with NaN removal from dataset class using group mean value
Posted: Feb 2, 2012 3:13 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,
I have question for removing NaN with nanmean of the "group" value. I am working with dataset class (since it is alrge amount of data).

Example below explains my data, further a solution I wanted for this is given down.
Example:
******************************************************************
grp var
'A' 5
'A' 5
'A' 5
'A' 5
'A' NaN
'A' 5
'A' NaN
'A' 5
'A' 5
'A' 5
'B' 6
'B' 6
'B' NaN
'B' 6
'B' 6
'C' 7
'C' 7
'C' NaN
'C' 7
*******************************************************************
*******************************************************************
Solution (I want) should be:
grp var
'A' 5
'A' 5
'A' 5
'A' 5
'A' NaN (replaced with value = 5)
'A' 5
'A' NaN (replaced with value = 5)
'A' 5
'A' 5
'A' 5
'B' 6
'B' 6
'B' NaN (replaced with value = 6)
'B' 6
'B' 6
'C' 7
'C' 7
'C' NaN (replaced with value = 7)
'C' 7
******************************************************************
******************************************************************

Any help in removing NaNs with this approach (of nanmean value of group) will be appreciated.
Thanks a ton in advance,
Shatrughan



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.