如何在stata中输出一个本地值,我正在使用下面的命令,但它在Stata 12中给出了一个错误variable local not found
sysuse auto
summ price,de
outsheet local p1 local p99 using "range\range.csv", replace c
我也试过
outsheet r(p1) r(p99) using "range\range.csv", replace c
但误差factor variables and time-series operators not allow
我是新来的,我在市场分析方面做了很多工作。大多数时候,我收到了一个包含很多变量(10 - 15)的巨大基数,人们问我:根据我们拥有的变量(年龄、性别等),如何解释收入的增长或下降?
我通常通过查看图表并分析每种可能的情况来做这件事,但我真的相信有一种更好的方法来做到这一点。
age sex business_unit year month revenue name
10-20 Male unit_1 2018 1 $100 chloe
20-30 Female unit_2 2019 2 $250 arn
我有一个类似于下面的数据集,我想根据百分位数将我的值分类为高/中/低。我使用以下内容,但我对99%和高于此值的值感到困惑。
data(iris)
quantile(iris$Petal.Length, probs = 0.01)# all the values less than 1.149 are low
quantile(iris$Petal.Length, probs = 0.99)# here must be the high-values category
问题:
值大于99%百分位数(6.7)。这些值属于哪里?,,什么是中间类别?
我使用Simba驱动程序(2.3.2)将Stata与BigQuery从我的macOS笔记本电脑连接起来。我最近升级到大苏尔(11.2.1),失去了这样做的能力。
我正在使用iODBC,我能够成功地测试DSN。我还可以在macOS 10.15.7 (在另一台机器上)完成所有的工作。
问题似乎是Stata没有看到我根据驱动程序配置说明在我的DYLD_LIBRARY_PATH配置文件中定义的.bash_profile环境变量。
在Stata中,我得到了一个错误:
. odbc list
The ODBC file libiodbc.dylib could not be found on this s
我试图手动计算列值的分位数,但与Pandas的结果输出相比,无法使用公式手动找到正确的分位数值。我四处寻找不同的解决方案,但没有找到正确的答案。
In [54]: df
Out[54]:
data1 data2 key1 key2
0 -0.204708 1.393406 a one
1 0.478943 0.092908 a two
2 1.965781 1.246435 a one
In [55]: grouped = df.groupby('key1')
In [56]: grou
我需要一个小程序:
读取自然数n然后读取n个实数r0,r1,r2,.,rn然后读取另一个实数x
然后打印x的大小(与r0,r1,r2,.,rn )相关的百分位数。
#include<stdio.h>
int main(){
int n, i=0;
double r[1000], x;
printf("Enter how many numbers\n");
scanf("%i", &n);
printf("Enter numbers\n");
while(i<n){
scanf("%lf&
在Stata中,我希望能够根据特定的变量将观察结果放入桶中,或者将观察结果等效为属于某个分位数的代码。我四处寻找一些能够完成这项任务的现有代码,但没有完全找到我想要的。我写了以下简单的文章:
program toquantiles
version 13
syntax varname [, n(integer 4)]
quietly{
local interval = 100/`n'
local binVarName = "`varlist'_quantile"
gen `binVarName' = `n'
我试图在R中复制一些Stata结果,并且遇到了很多麻烦。具体来说,我想恢复相同的特征值,在探索因素分析中Stata所做的。为了提供一个具体的示例,Stata中的factor帮助使用了bg2数据(关于内科费用),并给出了以下结果:
webuse bg2
factor bg2cost1-bg2cost6
(obs=568)
Factor analysis/correlation Number of obs = 568
Method: principal factors Ret
我现在在postgres上被困在计算中位数上,因为postgres中没有关于计算中位数的函数。下面是我的查询,我想要得到该查询的中位数。请教我怎么做。
SELECT count, conversion, company_id FROM (SELECT count(ap.id),
(count(ap.id)/cast(NULLIF(SUM(j.views), 0) as float) * 100) AS conversion,
j.company_id FROM applications ap RIGHT JOIN jobs j ON ap.job_id = j.id GROUP BY j.
在运行宏%better_means之后,我收到了一条错误消息,但我不确定要正确计算汇总统计数据,必须更改哪些选项。
WARNING: A shortage of memory has caused the quantile computations to terminate prematurely for QMETHOD=OS. Consider using
QMETHOD=P2.
NOTE: The affected statistics will be missing from the corresponding classification level