[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Creating a distance variable in SPSS

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 2

File: IBM_SPSS_v23.png (15KB, 120x120px) Image search: [Google]
IBM_SPSS_v23.png
15KB, 120x120px
I'm using SPSS to create a variable that is supposed to show the numerical distance between a case and a given value. My mathmatical/programming skills are too limited to figure this out though and I could not find any tutorial pertaining to this online. Does anyone here have an idea on how to compute this?

To be clear, what I need is the distance from a case to a given number where the given number is always the same for instance at a given value of 10:
Case says: 4
Distance is 6

Case says: 15
Distance is 5

I have no clue how to fix this mathmatically or as a function in SPSS. Any help would be greatly appreciated.
>>
dist=|case-10|
?
>>
>>135687
Thats what I tried first but I need distances as positive numbers, that method also gives negative answers.
>>
File: edgar wat.jpg (23KB, 299x169px) Image search: [Google]
edgar wat.jpg
23KB, 299x169px
>>135690
>absolute value
>negative numbers
>>
>>135691
I literally do not know what those things mean. I'm a political science student so I can't into math at all... Am I missing something here?
>>
>>135694
https://en.wikipedia.org/wiki/Absolute_value

I don't believe you have never heard about this.
>>
>>135687
I get it now... the | | is the important bit.

>>135690
>>135694
I'm retarded.

Thank you very very much.
>>
Update: SPSS can't handle the | | part. I found out that you can compute a variable with negative and positive values into an absolute value variable using the command:

COMPUTE new_var=ABS(old_var)

So I guess to get it to work in SPSS takes 2 steps.
>>
>>135703
If only there were some way to combine two expressions.
>>
>>135709
I sense a bit of sarcasm but thats okay, I know I'm completely retarded when it comes to this stuff but it works now so I'm happy enough :)
Thread posts: 10
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.