Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
webuse drugtr代码在Stata中不起作用_Stata - Fatal编程技术网

webuse drugtr代码在Stata中不起作用

webuse drugtr代码在Stata中不起作用,stata,Stata,此代码在Stata中不起作用: webuse drugtr no; data in memory would be lost 我需要安装软件包吗?如何运行此代码?正如错误所述,您应该已经将数据加载到Stata中,并且它警告您内存中的数据将丢失 添加选项,clear应该可以解决这个问题,因为它会告诉Stata可以丢失以前加载的数据 例如,这将不起作用: clear all // create a one variable data set called x1 // that contains

此代码在Stata中不起作用:

webuse drugtr
no; data in memory would be lost

我需要安装软件包吗?如何运行此代码?

正如错误所述,您应该已经将数据加载到Stata中,并且它警告您内存中的
数据将丢失

添加选项
,clear
应该可以解决这个问题,因为它会告诉Stata可以丢失以前加载的数据

例如,这将不起作用:

clear all
// create a one variable data set called x1 
// that contains 100 observations with the number one.
set obs 100
gen x1 = 1
*your line
webuse drugtr 
*no; data in memory would be lost
*r(4);
这将起作用

clear all
// create a one-variable data set called x1 
// that contains 100 observations with the number one.
set obs 100
gen x1 = 1
*your line
webuse drugtr , clear
*(Patient Survival in Drug Trial)

因此,您不必安装任何软件包来加载数据。

我使用,清除,我的问题就解决了。谢谢you@CgdmmStackOverflow的习惯是在解决问题时接受答案。