SPSS - how to rescale the x-axis - spss

How to rescale the x-axis in spss? I have a graph like this:
I would like to rescale the x-axis from 1 to 5, even if the data for 1 and 5 has 0 percentages.
Thank you very much.

I think you should label all the values of the variable of the X axis for them to appear.
According to this source SPSS defaults at showing empty categories as long as they are labeled:
https://www.ibm.com/support/pages/how-display-empty-or-unselected-categories-spss-standard-charts
So, in syntax.
Value Label variable_of_x_axis
1 "1"
2 "2
3 "3"
4 "4"
5 "5".
Or you can label them using the user interface.

Related

how do I convert a negative number into a positive one?

I want to show positive movement in numbers. In my case moving from 4 to 3 is positive movement.
In my Google Sheets, I have 4 in cell B1 and 3 in C1. The percent change value is 1 and percent change is 33% improvement. If I use this formula =(b1-a1)/b1 I get -33%. What formula do I use to get 33% as the returned percent?
Try using ABS() function. Something like this:
ABS((b1-a1)/b1)
try like this:
=((B1-A1)/B1)*-1

Google Sheets hover label from different values

I am working on a Google Spreadsheet with several columns of data. I have made a chart that pits two of those columns against each other, showing that in general, when one value increases, the other one decreases. When I hover over a datapoint, it mentions the exact value of both the x- and y-axis. However, I would like it to show the value from the same row in a different column, the label of the values I'm displaying, so I can easily see where the values belong. Is it possible to customise the hover label in this way? I could not find it in the graph settings and online search did not yield any results either.
This is an impression of the sheet I have:
Label x-value y-value
aaa 130 0
bbb 110 7
ccc 100 10
ddd 50 30
eee 75 23
fff 20 42
I would like the hover to show me aaa for the first value for example.
This is the real graph with a hover label:
550
x: 49
I would like it to show the "name" of that row instead.

How to make scatter plot in google sheets using 2 columns as X and Y values and the 3rd columns to get color of that point?

I have 3 columns in a google spreadsheet
Runs Balls Result
24 24 W
50 20 W
10 5 L
12 10 L
5 2 L
Now I want a scatter plot to be made, such that Runs and Balls are the X and Y axes, and the color of the point is determined by the values in the column Result.
How do I achieve this?
You could separate your second column (y-value, "Balls") into two separate columns, depending on if the Result is W or L. In other words, make a chart based on three columns instead of two. This way, two different colors will be assigned automatically when the chart is generated. (Later, you can change these colors by double-clicking on the chart to get to Chart Editor -> Customize -> Series -> Format -> Color).
There seem to be no good solutions here. Answer from Monaco works but is inconvenient in cases. I settled for adding the third column as a label for the second one.

Calculate the average of the top 80% of values in a column Google Sheets

How can I get the top 80% of an unsorted column of values that includes 0s?
values
1
1
0.3333333333
1
1
1
1
1
0
0
If the top 80% of values to average is not a rational number, I need it to average both above and below the rational number:
(e.g. 11 values * 0.8 = 8.8 values to consider, so it should average the top 8 and the top 9 values)
so far I've this: =AVERAGEIF(A1:A12,">"&PERCENTILE(A1:A12,80%))
do it like this:
=IFERROR(AVERAGE(INDIRECT("A1:A"&COUNTA(A1:A)*80%)),
{AVERAGE(INDIRECT("A1:A"&ROUNDDOWN(COUNTA(A1:A)*80%)));
AVERAGE(INDIRECT("A1:A"&ROUNDUP(COUNTA(A1:A)*80%)))})
If by 'top 80%' you mean the largest 80%, I would use sortn:
=average(sortn(A:A,rounddown(count(A:A)*0.8),,1,false))
and
=average(sortn(A:A,ROUNDUP(count(A:A)*0.8),,1,false))
The average of the top 8 numbers is 7.5 and the average of the top 9 numbers is 7.

How to generate a certain amount of numbers and spread them randomly across a grid?

I want to generate the number 2 5 times and the number 1 10 times. I'm trying to spread these across a String Grid in Delphi randomly. I also want to fill the rest of the grid that isn't 1 or 2, with 0's. I have no idea how to even start here.
It would look something like this (P stands for player and there would only be 5 2's and 10 1's): https://gyazo.com/aeef05c3a92ce7847c0f42ad40faa733
Given a grid with dimensions m×n, create an array of length m * n. Put five 2's and 10 1's in the array, and fill the remainder with 0's. (We'll assume the product of m and n is at least 15.) Shuffle the array. Copy each element of the shuffled array into successive cells in the grid.
While the approach represented in Robs answer will do the job I personally think it is way to complicated for it's purpose.
So what would be more simpler approach?
Well your goal is to place these numbers at random positions in grid.
How do you determine position of some object in a grid? You do it by its X (Column) and Y (Row) coordinates.
So how do you get random position in a grid? Simple chose two random values for X and Y coordinates.
As for placing certain numbers of number 1 and number 2 use two simple loops.

Resources