It’s a method of the TV, though, not the resource.
I think this is how it’s supposed to work (I was having trouble with it today, so YMMV).
You have to get the TV first, then set it:
$tv = $modx->getObject('modTemplateVar', array('name=>'TvName'));
$id =12; /* id of the resource whose TV you want to change */
$tv->setValue($id, 'newValue');
$tv->save();