trinker / qdap

Quantitative Discourse Analysis Package: Bridging the gap between qualitative data and quantitative analysis
http://cran.us.r-project.org/web/packages/qdap/index.html
175 stars 44 forks source link

Polarity score calculation (again) #141

Closed iokat closed 11 years ago

iokat commented 11 years ago

I was testing the new function, with the example "not really affordable". As expected it provides the same output as "really not affordable" (-0.1154701). But the problem is that I cannot figure out the result based on the new documentation (equation):

There is one positive word, so the second part of the product gives -1 (because there is only one negator (-1)^1=-1).

So now we have something like this: delta = (1 + c(x^A - x^D))(-1) / sqrt(3) =(1+ 0.8 (1 - 0))(-1)/sqrt(3) = -1.8 /sqrt(3) = -1.039...

I am confused about how this works exactly.

Thanks

trinker commented 11 years ago

I updated the formulas (I'm not a mathematician but can describe it in words and computer code but struggle with math notation; so I had to make my formula match what's happening in the algorithm).

delta = (1 + c(x{i}^A - x{i}^D))(-1) / sqrt(3) delta = (1+ 0.8 (0 - 1))(-1)/sqrt(3) delta = -.2 /sqrt(3) delta = -0.115

I think this is clearer now. Note I used the formula that will sum all contexts surrounding polarized words and then divide by sqrt(n) but this has not actually been done in the code yet and won't be updated until after the first of December (I have a project/conference I'm planning/writing for). So long as there are not 2 polarized words there should be no problem.

See issue #140

iokat commented 11 years ago

Oh, OK, thanks for the answer. If you need any help with the math, let me know. I think I'll implement my own function for the time being.