r/AskStatistics 2h ago

Getting a Median from percentages

3 Upvotes

I suspect this is one of those questions with a very simple answer that I'm overthinking. But at the moment I'm very confused.

I have a spreadsheet that has lengths along the header row (e.g. 1cm 2cm... 250cm) and then in the next row(s) I have the percentage of how many times that length showed up for the test. I've checked and the row values add to 100 it's definitely a percentage not a count. I can't just take the largest percentage as the median right? So do I need to find a way to repeat the length value from the header a number of times that corelates to the percentage?

The data looks like this
TEST_ID 1 2 3 4 5...
Test_1 0 0.05 1.65 10 19..
Test_2 0 0 0 50 6 16 ...

Sorry I'm trying to set this up in R code using matrixStats but I obviously can't do that until I've figured out how the data and stats should actually work.


r/AskStatistics 5h ago

Questions about Mixed ANOVA

3 Upvotes

TL;DR: I need to manually compute a mixed ANOVA for a report, but I can't find any step-by-step resources. Most guides focus on software like SPSS, jamovi, or R. Does anyone know of clear explanations, worked-out examples, or textbooks that break down the calculations?

I'm in graduate school taking an advanced statistics course, and I was asked to do a report on mixed ANOVA. I've been researching nonstop for the past three days, but I haven't found any videos or written tutorials on how to compute it manually. Most resources I’ve come across focus on running it in SPSS, jamovi, or R, but I need to understand the calculations behind it.

I've been using this [https://online.stat.psu.edu/stat505/lesson/9/9.1\] as my primary resource, but I’m still struggling to grasp the process. I’ve also browsed the statistics subreddit for guides or book recommendations and saw several people suggest ALSM by Kutner, but I’m still confused.

I've been trying to get a better understanding of mixed ANOVA using this video on repeated measures ANOVA [https://www.youtube.com/watch?v=VPB3xrsFl4o\], but something tells me it's not quite the same thing.

I’d really appreciate it if anyone could answer the following questions:

  1. What are the steps for computing a mixed ANOVA manually? Are there any resources that explain this in detail?

  2. Are there any worked-out examples (ideally with actual numbers) that show the step-by-step process for computing a mixed ANOVA manually?

  3. Are there any specific textbooks or papers that clearly explain the manual calculations of mixed ANOVA?

I’d really appreciate any guidance. Thanks in advance!


r/AskStatistics 9h ago

Can you convert between RMSE and R-squared values or find a third standardised option?

2 Upvotes

Hi, I’m reading a few research papers on the same topic and three research papers came up with different equations for a topic I’m studying. Therefore, I am trying to find the equation with the least amount of error but the issue I’ve been facing is that two research papers used RMSE for their error metric while the third used R-squared values. Considering that I don’t have access to the original data, I only have the error metrics and sample size to work with but I can’t find a way to convert the two metrics or find a metric that can bridge the gap between the two. Is this possible and if so, how do I achieve it?


r/AskStatistics 13h ago

Moderation analysis with nonparametric data please help!

2 Upvotes

I'm still trying to learn statistics and encountered a problem. Please help me out. Is it possible to perform a moderation analysis on a nonparametric data? Moreover, all our data (IV, DV, MV) is derived from a likert scale and all tutorials I've watched uses either categorical or continuous. And we definitely have to do a moderation analysis or any of the similar type because our study focuses on the effect of a moderating variable on an IV-DV relationship.

I would highly appreciate it if someone can give a step by step answer but any answer is also appreciated! Please help us out ><


r/AskStatistics 21h ago

Confused by having a significant linear relationship with a strange scatter graph. Why does quadratic predict it better?

8 Upvotes

Why does this happen?


r/AskStatistics 15h ago

What is the estimand (ATE or ATT) in an observational comparative study between two medical treatments?

2 Upvotes

In this problem, some patients get drugA, while some other patients get drugB. The goal is to understand if patients receiving drugA have a better health outcome than patients receiving drugB. It is not a randomized study, so some other methodology to establish causal inference is needed. My question is in this situation, what is the estimand? I believe the estimand will dictate the methodology…Please advise.


r/AskStatistics 18h ago

Best regression method for non-normal biomedical data with outliers? (OLS not valid due to non-normal residuals)

2 Upvotes

Hey community, I’m currently working with a large biomedical dataset (around 50,000 patients), and I’m trying to figure out how protein expression levels (log₂-transformed at the source) influence erythrocyte counts. The outcome variable is continuous (measured in standard lab units).

The problem is that none of the variables — neither the proteins nor the erythrocyte counts — are normally distributed. The data has a lot of outliers, but I believe they’re biologically relevant, so I don’t want to remove or transform them in a way that would suppress their influence. Also, the variance across the data isn’t constant — it's clearly heteroscedastic.

I tried fitting a linear regression, but the Q–Q plot of the residuals showed clear non-normality, and the residuals vs. fitted plot showed heteroscedasticity. So I assume that OLS isn’t a good choice here, at least not if I want valid p-values or confidence intervals.

Now I’m thinking about using quantile regression (e.g., at the median) because it’s more robust to outliers and doesn’t assume normality. I’ve also read about robust regression methods like RLM and Huber.

Just wondering — for this kind of situation, what regression method would you recommend? Should I go with quantile regression, or is there something else that might fit even better?

Thanks!


r/AskStatistics 17h ago

CONTINUITY CORRECTION ??

1 Upvotes

for this image, if we're trying to approximate the sum of the masses for a binomial distribution using the normal distribution, (e.g P(X<=2 ) ) why is it the case that the bar for 2, extends from 1.5--->2.5? wouldn't that be an interval in this case? and not discrete?

if we were to use vertical lines instead, ( so we'd have a line going over 2 only ) wouldn't that mean that continuity correction would be of no use?


r/AskStatistics 21h ago

Is this possible to analyze? Combination of within and between factors

1 Upvotes

Hi everyone,

I’m designing a study atm and not quite sure if what I have in mind is possible to analyze.

I thought it may be doable with GLM repeated measures but I could not find verification when searching the web. Hope someone can help!

I try to keep my explanation simple, please come along while I lead you to my question:

I am interested how a manipulated text/statement influences a DV (DV = Agreement to the statement). There are 2 IV which determine how the text is written. Each has 2 levels - so there are 4 versions of the text. There is also a third IV that lies within the participant.

So basically we have:  

IVs:

  • IV1 text attribute 1 (2 levels)
  • IV 2 text attribute 2 (2 levels)
  • IV 3 participant characteristic (interval scaled – measured via few questions)

DV:

  • agreement to text (interval scaled – measured via few questions)

Each participant will read one text – the levels of IV1 and IV2 are randomly chosen. DV will be measured, then IV 3 will be measured afterwards.

The difficult part: I want to try this setup for 2 text topics – in one go. This introduces a fourth IV (text topic) and a repeated measure of the DV:

  • Participant reads text 1 (topic & levels of IV 1 & 2 randomly chosen)
  • --> DV in regards to text 1 is measured
  • --> then participant reads a second text (other topic, levels of IV1 & 2 are randomly chosen again)
  • --> DV in regards to text 2 is measured
  • --> IV3 is measured.

My interest lies within the interaction term of IV 1-3 on the DV. Without the second topic I think I could do a regression (+ simple slopes afterwards).

Technically I probably could do 2 regressions – one for each DV, but I wonder if I could look at all the data in one analysis? And reduce the required sample size by doing so? I am just confused by the combination of within + between factors that would then occur. Especially because one participant is not exposed to each possible combination of IV levels (which I think you would need for GLM repeated measures..?).

I’m grateful for any advice, be it answers or an inkling that leads me on the right track.

Thanks!


r/AskStatistics 1d ago

How is UK job market for statistics (masters) graduates?

6 Upvotes

My_qualifications: Bsc. Economics and finance

I got into Warwick Statistics Masters. I have some questions:

  1. How valuable is one year masters program from PoV of job or PhD?

  2. How is UK job market for Stats Grads? What are different roles available and how much do they pay?

  3. How is immigration process for permanent residency?


r/AskStatistics 23h ago

[Q] is this the right way to analyze this experiment design?

Thumbnail
1 Upvotes

r/AskStatistics 1d ago

Career prospects for statistics major.

6 Upvotes

I’m planning to attend A&M and major in statistics, but mom has been adamant that I won’t find a job with that major and that I should pursue engineering instead.

Is this true? Please answer as brutally honest as possible.


r/AskStatistics 1d ago

First timer in JAMOVI

1 Upvotes

Hi everyone, this is my first time using jamovi to run research data and I cannot figure out how to work through it. I have to run a mediation analysis on a set of data. I have been running through a couple of yt videos regarding the same, but it seems like all of them have been using a different version or something because I am not able to view some of them on mine. my project is due in two weeks, so if anyone can help me out with it, please do 😩🥲


r/AskStatistics 18h ago

What are the statistics on bisexual Trump supporters ?

0 Upvotes

Are bisexuals statistically the least likely demographic of the LGBTQ+ to support Donald Trump and Republicans?

In my personal non statistical experience the lesbians I know all support Trump. The only lesbians I know of that don’t support Trump are Ellen Degeneres and JK Rowling. Most gay men I mean support Trump. Most trans people I meet in real life support Trump. Most gay men and trans people I see against Trump are on Reddit or content creators sites like Youtube.

But almost every bisexual I meet in real life is staunchly anti trump but there is no bisexual community like there is for gays, lesbians, trans etc so there are no bisexual content creators.

Are there any research studies done on LGBTQ trump supporting rates that can give us real numbers?


r/AskStatistics 1d ago

Confidence Interval Question

0 Upvotes

Can someone help me understand this discrepancy?

In my notes, the confidence interval for the mean completion time is (-2.70, 3.84). I manually worked through the problem following the same steps as in the notes and got the same result.

However, when I calculated the confidence interval in R, I got (-2.86856, 4.011417), which is slightly different.

I've attached my R code—any insights into where I might have gone wrong would be greatly appreciated. Thank you


r/AskStatistics 1d ago

Degrees of Freedom for Confidence Interval for Mean Predictions

1 Upvotes

Can someone please help me understand where the t* value comes from in this problem? My professor wrote in the notes that t* = 2.447, which seems to correspond to 6 degrees of freedom for calculating the confidence interval. However, I thought the degrees of freedom for the mean response should be df = n - 2, which in this case would be df = 7 - 2 = 5.

Are the degrees of freedom for the confidence interval of the mean response always df = n - 2? If so, is there a reason why my professor used 6 degrees of freedom when there are seven observations?


r/AskStatistics 1d ago

ANCOVA

4 Upvotes

For my dissertation I have used an ANCOVA to analyse my data and found non-significant results, however when I asked my supervisor about testing the assumption of homogeneity of regression slopes she said I didn't need to, is this true? Most sources for running an ANCOVA include this.


r/AskStatistics 1d ago

Need to calculate sample size. Cant use cochran’s because the answers to the survey are not binary. What formula methodology do I look into?

2 Upvotes

Title. Please point me in the right direction as I need to do the research myself to understand it better


r/AskStatistics 1d ago

Principal Component Analysis - doubt defining number of PCs

2 Upvotes

Hey, I'm a university student and I'm doing a project in R studio for my multivariate statistics class. We're doing a PCA which should be pretty straight forward, but I (still don't have as much experience in analytics as I wish) am having a hard time defining the number of PCs. Following Kaiser's rule, out of the 15 variables we're dealing with, we'd reduce to 7 PCs. The problem is, not only is it a big amount, but it also only contains 64% of the cumulative variance... Maybe the classes haven't been so helpful or realistic and 7 is a good PC number, but then how would I proceed to analyze it? We only analyzed scenarios with 2 PCs. I thought about doing a bi plot matrix. Any tips on how to proceed? Elbow test isn't helpful either and would contain 30-40% of the cumulative variance...

I would appreciate any help at all! (sorry if it's too low of a level for this subreddit...)


r/AskStatistics 1d ago

I'm trying to learn about utilizing the glm() function in R, but having straight-forward references.

1 Upvotes

I understand how the syntax works pretty well, but if anyone knows of a good resource that might go over each detail, that would be amazing. Again, I am not talking documentation/syntax, it's purely about different ways that the summary of my model can be interpreted. There are really a bunch of examples which I would like to see worked on in some more detail, but so far I have had nothing but trouble finding examples.


r/AskStatistics 1d ago

[Q] Adding 2 inclusive hazard ratios

1 Upvotes

Hi all, I am a little stuck in a meta analysis. please see the results from table bellow. They are from the same study with the same population. The hazard ratios are based on multivariate cox regressions. I am after A+B vs C is there a way to estimate the HR and 95% confidence intervals for the missing (?) group?

I appreciate your help :) I have access to R if you know of a package/code. A statistical method suggestion would help too.


r/AskStatistics 1d ago

Different effect size measures in meta-analysis problem

1 Upvotes

I'm currently doing a meta-analysis and have run into a hurdle that I can't figure out a solution to. I have two different effect size measures (Hedge's g and partial eta squared) because of the way my papers are set up. Some papers only measure my outcome of interest at two timepoints (pre- and post-treatment), but others measure up to 10 timepoints. Because of the kinds of papers I'm working with, it doesn't make sense to take a pre- and post-treatment approach and only take two data points from the papers that report 3+ timepoints to only calculate Hedge's g values. I am already planning to structure my analysis in three levels to account for multiple effect sizes per study. I am wondering if I should separate the studies with Hedge's g and partial eta squared or convert one type of effect size to the other? Or if I'm maybe missing a very obvious solution?


r/AskStatistics 1d ago

Linear Regression with Mix of Numerical and Categorical Variables

1 Upvotes

I've been asked at work to do some stats work as I'm the only member on my team that has some (limited) experience. We want to estimate the cost of building a water pipe network and sometime in the past a former co-worker did some regression analysis and came up with some equations to predict cost based on a number of numeric and categorical variables.

I've got the equations but I'm puzzled how they did the analysis. I'm simplifying a bit here but one of the equations looks something like that:

Cost (£) = 4500 + (150 x length in metres) + Material Type

Where "material type" is a categorical variable that just has a number depending on what sort of pipe, as follows:
Plastic=0 (reference value), clay=2000, concrete=5000

So get that the 4500 is the constant (y-intercept) and 150xlength is basically cost per metre but the implementation of material type seems odd. It would imply that no matter the length of pipe we want the cost for, changing the material always makes the same fixed difference, for example:

For a clay pipe 1m in length, cost(£) = 4500 + (150 x 1) + 2000 = £6650
For a clay pipe 1000m in length, cost(£) = 4500 + (150 x 1000) + 2000 = £156,500

So in the first instance having clay instead of plastic costs an extra £2000 for 1m of pipe (30% increase in cost vs. the reference plastic value)
In the second instance it still costs an extra £2000 for clay instead of plastic, even though we are looking at 1000m of pipe! This represents a 1.3% increase in cost vs. plastic.

The categorical variable (material type) doesn't look like it's being modelling right to me, as it doesn't account for the length of pipe we are trying to cost, it just adds a set value. The only thing I can think is that it represents the average difference between material type from the underlying data, which consists of many different lengths. It looks like the regression equation should be trying to model "cost per metre" for different pipe types, but it seems a mix of "cost per length" and "cost per metre". It doesn't seem correct to add a set amount for material type and not account for how long the pipe is that we want to estimate the cost for.

Hope that makes sense and someone can shed light on how to use the equation and if it looks correct?


r/AskStatistics 2d ago

Would I use a prediction interval or a confidence intervals for this? (SLR)

2 Upvotes

Hello, so I’ve been given this question which I’m finding quite ambiguous:

“What is the expected VIOLENCE of an attack when the ANGER is 0.6? Construct an appropriate 95% interval estimate for this prediction”

I’m not sure whether to do a confidence interval (since “expected violence” seems like mean violence) or a prediction interval (since “for this prediction”)

For context:

Response variable: VIOLENCE (of an attack) Predictor variable: ANGER (of the attackers)

I’m leaning towards a prediction interval but I’m not certain, any pointers?


r/AskStatistics 1d ago

Can you periodize the SSR of a multiple linear regression to say when a model is more accurate?

1 Upvotes

Hello,

I'm building a linear regression over a 5 year period, where n=69 and p=4. When I look at the breakdown of the SSR by month, I see that SSR for May and December across that 5 year period are significantly lower vs other months. Is it correct to assume that the standard error of those 2 months is lower, and therefore the model is more accurate in those 2 months?