Stata Incidence Rate Ratios - stata

webuse stan3
stset
stptime
stptime, by(surgery)
stir surgery
My objective is to estimate incidence rate ratios for surgery vs non surgery but in a setting when I have individual-level sample weights to weight up to a population of interest. How can I estimate the incidence rate ratios while incorporating these sample weights?

Related

PowerBI weighted average

I struggle with calculating rolling weighted average in PowerBI but with pre-defined weights
In other words, I need to calculate a weighted average for each "window" of data where each data has a weight assigned depending how old the data is in the particular time frame.
Is there anyone who can help, I would be grateful! :)

How to calculate float confidence interval in Stata?

When estimating the risk ratio of a variable with multiple categories, I did not see many using floating confidence interval which is an absolute scale, instead, people are used to the conventional confidence interval, which is a relative scale. How can I calculate float confidence interval in Stata? Thanks!

How to eliminate outliers while calculating standard deviation in a measure in PowerBI measure

I am relatively new to PowerBI, I want to calculate the Standard Deviation of a parameter eg: Temperature for each batch based on different filters.
This standard deviation has to be calculated by a measure
and it has to be displayed in a Card
But I need to eliminate outliers before calculating std deviation.
How can I Do it in measure?
Outliers condition is Values greater than 99 percentile and less than 1 percentile to be considered as outliers
If You need to work with percentile then use function in your logic
https://www.youtube.com/watch?v=5AxtNdJ5wqk
https://dax.guide/percentile-exc/
https://dax.guide/percentile-inc/
Usefull statistical patterns:
https://www.daxpatterns.com/statistical-patterns/

SAS Proc Logistic Selection=Score

I'm using PROC LOGISTIC procedure in SAS and option SELECTION=SCORE which gives me few logistic regression models and their Chi-Square values. My question would be which model is better - with smaller Chi-Square or bigger?
In general, the larger chi-squared statistic will correspond with a lower p-value (more significance). However, it is important to know the shape of the chi-squared distribution and also the number of degrees of freedom. As you can see in the graph, the relationship between p and chi-squared changes based on the degrees of freedom.
Score for Chi-Square is larger, the model is better.

WEKA software analysis for calculating total accuracy

Hi i am using WEKA to analyze some data. But i am having problem how to calculate the total accuracy from the output data.
The partial output is bellow
Detailed Accuracy By Class
TP Rate FP Rate Precision Recall F-Measure ROC Area Class
0.85 0.415 0.794 0.85 0.821 0.762 tested_negative
0.585 0.15 0.676 0.585 0.627 0.762 tested_positive
Weighted Avg. 0.758 0.323 0.753 0.758 0.754 0.762
From the above what will the total accuracy?
What's your confusion matrix from WEKA output?
In general case, it is necessary to know it to calculate accuracy.
And yes, I think "total accuracy" in this case means this accuracy:
http://upload.wikimedia.org/math/8/5/f/85fb106488e3cb8c02e397c917222ad4.png
(from http://en.wikipedia.org/wiki/Accuracy_and_precision)
You can see the correctly classified instances reported in the summary part (a little bit above the part it's reporting the accuracy by class). in front of this part you can see a number (which indicates the number of instances) and a percentage (which is the accuracy).