摘要:
//stritrim(s1)将s1中的多个连续空格缩减为一个空格 . disp stritrim("good 123") good 123 //strltrim(s1)将s1中左侧的空格删除 . disp strltrim(" good 123") good 123 //strltrim(s1)将s 阅读全文
摘要:
*split字符分隔 *1,2,3 -- > 1 2 3 clear //清内存 set obs 5 //设置5个样本 gen v1 = "1 2 3" //建立新变量,v1,其值都是"1 2 3" split v1,gen(a) //分隔v1,建立以a开头后面是分隔字符的变量名,空格是默认分隔符 阅读全文
摘要:
//清除内存 clear //设置5个样本 set obs 5 //增加变量v1,都是this is the day gen v1 = "this is the my is day" //增加新变量,v1_replace,其值是替换v1中的第一个is为X gen v1_replace = subin 阅读全文
摘要:
local sj=subinstr(subinstr("`c(current_time)'",":","",.)," ","",.) local wjma="`sj'" set seed `wjma' clear local shu= int(100*runiform() ) // local xm 阅读全文