摘要: Relational Arithmetic Logical (numeric and string) + addition & and > greater than - subtraction | or < less than * multiplication ! not >= > or equal 阅读全文
posted @ 2023-02-24 21:21 myrj 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 变量抽取 sample 10,count//简单随机抽样,抽取10个观测值 sample 10 if female==1,count//在女性数据中抽取10个样本并保留所有男性样本 sample 10 ,count by(female)//在男性和女性样本中各抽取10个样本 sample 5 ,co 阅读全文
posted @ 2023-02-24 15:31 myrj 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 变量转换 encode sex,generate(gender)//生成数值型变量gender decode gender,generate(gender2)//根据gender变量重新生成一个字符型变量gender2 recode x2(1 2=1)(3=2)(4/7=3),gen(nx2)//改 阅读全文
posted @ 2023-02-24 15:14 myrj 阅读(157) 评论(0) 推荐(0) 编辑
摘要: bysort female:egen educmed=median(educ)//赋值为educ受教育年数中位数,这项工作要求分性别进行 egen higheduc=anyvalue(educ),v(13/18)//生成一个新变量higheduc,如果educ大于12则higheduc包含这个变量的 阅读全文
posted @ 2023-02-24 15:05 myrj 阅读(704) 评论(0) 推荐(0) 编辑
摘要: list // // + + // | make price mpg rep78 headroom trunk weight length turn displa~t gear_r~o foreign | // | | // 1. | AMC Concord 4,099 22 3 2.5 11 2, 阅读全文
posted @ 2023-02-24 15:00 myrj 阅读(353) 评论(0) 推荐(0) 编辑
摘要: //如果有变量ifoi则删除该变量,否则命令即结束,准备产生新变量ifoi,如果有则删除,没有则进行下一步 cap drop ifoi //使用正则表达式 //建立新变量ifoi,如果yjszyyq包含”经济"值为1,否则为0 gen ifoi=regexm(yjszyyq,"经济") if yjs 阅读全文
posted @ 2023-02-24 14:48 myrj 阅读(528) 评论(0) 推荐(0) 编辑
摘要: //显示gwmc中包含“管理"的所有观测值 list if strmatch(gwmc,"*管理*") //使用正则表达式 //建立新变量ifoi,如果yjszyyq包含”经济"值为1,否则为0 gen ifoi=regexm(yjszyyq,"经济") if yjszyyq!="" indexno 阅读全文
posted @ 2023-02-24 14:47 myrj 阅读(1981) 评论(0) 推荐(0) 编辑
摘要: list ,separator(3) //列表,每隔3行划线 // // + + // | make price mpg rep78 headroom trunk weight length turn displa~t gear_r~o foreign | // | | // 1. | AMC Co 阅读全文
posted @ 2023-02-24 14:39 myrj 阅读(490) 评论(0) 推荐(0) 编辑
摘要: //所有缺失值都替换为9999 mvencode _all, mv(99999) override //替换换行 replace var = subinstr(var, char(10),"",.) 阅读全文
posted @ 2023-02-24 13:55 myrj 阅读(20) 评论(0) 推荐(0) 编辑
摘要: keep 序号 事业单位 主管部门举办单位 岗位类别 岗位等级 岗位性质 岗位名称 招聘人数 学历要求 学位要求 大学专科专业 要求 大学本科专业要求 研究生专业要求 其他条件要求 开考比例 笔试和面试成绩比例 咨询电话 备注 rename (序号 事业单位 主管部门举办单位 岗位类别 岗位等级 岗 阅读全文
posted @ 2023-02-24 11:28 myrj 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //输入一行英文,输出单词个数 (最开始 中间 最后可能有多个空格) #include <string.h> main() { char zf[101]; int a,b,c=0,d=0; gets(zf); a=strlen(zf); for(b=0;b<a; 阅读全文
posted @ 2023-02-24 09:28 myrj 阅读(117) 评论(0) 推荐(0) 编辑
摘要: /* 输入一个不大于4位正整数,判断它是几位数,然后输出各位之积。*/ #include <stdio.h> main() { int a,cj=1,wei=0,b; scanf("%d",&a); b=a; if(a<=9999 && a>=0) { do{ a=a%10; wei++; cj=c 阅读全文
posted @ 2023-02-24 07:54 myrj 阅读(94) 评论(0) 推荐(0) 编辑
摘要: /* 编写程序,输入一个学生的生日(年:y0、月:m0、日:d0); 并输入当前的日期(年:y1、月:m1、日:d1);输出学生的实际年龄周岁*/ #include <stdio.h> main() { int y0,m0,d0,y1,m1,d1,r; printf("请输入生日:\n"); sca 阅读全文
posted @ 2023-02-24 07:03 myrj 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //不用abs() fabs()函数输出任意整数的相反数 main() { int a,b; scanf("%d",&a); b=【1】; printf("%d的相反数为%d",a,b) ; getchar(); } #include <stdio.h> //不 阅读全文
posted @ 2023-02-24 06:15 myrj 阅读(139) 评论(0) 推荐(0) 编辑