经管之家App
让优质教育人人可得
立即打开
全部版块
我的主页
›
论坛
›
计量经济学与统计论坛 五区
›
计量经济学与统计软件
›
Stata专版
求助!!请问stata如何统计数据类型是字符串的出现次数
楼主
fgkjvbk
3726
2
收藏
2021-04-15
悬赏
10
个论坛币
已解决
各位stata的大佬们好,我想对数据中JournalTitle中出现的字符串进行统计,请问要怎么操作,谢谢回答!
clear
input long aid int pubyear str239 journal_title float(d_value career_age N)
4670844 2000 "The American naturalist" -.0556622 9 6
227960 2000 "Angewandte Chemie (International ed. in English)" 0 9 6
3279037 2000 "Journal of veterinary cardiology : the official journal of the European Society of Veterinary Cardiology" 0 9 6
8453307 2000 "IEEE transactions on ultrasonics, ferroelectrics, and frequency control" 0 9 6
8894826 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society" 0 9 6
4431279 2000 "The American naturalist" .0789474 9 6
527603 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society" -.025641 10 17
3412062 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society" -.012987 10 17
7351204 2000 "The American naturalist" -.0118483 10 17
1324929 2001 "Journal of evolutionary biology" -.00499445 10 17
7777752 2001 "Journal of investigative medicine : the official publication of the American Federation for Clinical Research" -.00144748 10 17
3472062 2001 "Calcified tissue international" 0 10 17
4513185 2000 "Bioscience, biotechnology, and biochemistry" 0 10 17
1070450 2001 "Phytopathology" 0 10 17
5663726 2001 "Journal of health psychology" 0 10 17
2608510 2001 "Journal of tropical pediatrics" 0 10 17
6304401 2001 "Comparative and functional genomics" .00172861 10 17
8096653 2001 "Mycorrhiza" .0078125 10 17
4717488 2000 "Avian pathology : journal of the W.V.P.A" .0163934 10 17
7188770 2000 "The American naturalist" .0632911 10 17
4452688 2001 "Angewandte Chemie (International ed. in English)" .0987654 10 17
5598028 2001 "Oecologia" .232877 10 17
9001194 2000 "Environmental management" .75 10 17
2373133 2002 "Oecologia" -.133333 11 34
5203462 2002 "Oecologia" -.072 11 34
4670844 2002 "Oecologia" -.0615385 11 34
5203462 2002 "Oecologia" -.0393701 11 34
4790330 2001 "The American naturalist" -.037037 11 34
8070924 2002 "Oecologia"
最佳答案
DΘstinyじò
查看完整内容
统计journal_title变量每一类值的个数吗?
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
全部回复
沙发
DΘstinyじò
2021-4-15 19:58:43
统计journal_title变量每一类值的个数吗?
复制代码
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
藤椅
阿斯顿马丁aa
2021-4-16 00:34:38
public class StringTest3 {
public static void main(String[] args) {
//定义一个字符串
String s = "Person1314Study";
//定义三个统计变量
int bignum = 0;
int smallnum = 0;
int numbernum = 0;
//遍历字符串,得到每一个字符。
for(int x=0;x<s.length();x++){
char ch = s.charAt(x);
//判断该字符到底是属于那种类型的
if(ch>='A' && ch<='Z'){
bignum++;
}
else if(ch>='a' && ch<='z'){
smallnum++;
}
else if(ch>='0' && ch<='9'){
numbernum++;
}
}
//输出结果。
System.out.println("含有"+bignum+"个大写字母");
System.out.println("含有"+smallnum+"个小写字母");
System.out.println("含有"+numbernum+"个数字");
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
相关推荐
stata 统计数据如何用变量形式保存?
Stata有关的各种命令(按各检验方法和数据类型等分类)
Stata统计数据均值:把A列变量等距分成十份,计算相应B列的均值
stata不同数据类型合并
stata中怎么把日期格式具体到天的只保留年份?
stata bys统计数据出现的次数排序
中国县级统计数据stata整理版
stata怎么转换字符串数据类型
stata进行面板数据固定效应回归的数据类型有无要求啊
关于str求助,用stata用城市名和年份合并两份数据,结果城市名数据类型不同
栏目导航
Stata专版
学道会
经管文库(原现金交易版)
经济金融数学专区
经管高考
新手入门区
热门文章
CDA 数据分析师:统计制图实战指南 —— 让 ...
【24重磅,自用整理!】2000-2024上市公司投资 ...
视频媒体:AI漫剧爆发在即,重视产业链机遇
范撒普《实现财务自由的安全策略》
量子科技行业深度报告:量子革命:量子科技 ...
新宏观丨对刘元春关于新凯恩斯主义六点共识 ...
俄语–英语双语图解词典
先进空中交通2025年
export slowdown and increasing land supp ...
“十四五”能源发展成就报告
推荐文章
AI狂潮席卷学术圈,不会编程也能打造专属智 ...
10月重磅来袭|《打造Coze/Dify专属学术智能 ...
最快1年拿证,学费不足5W!热门美国人工智能 ...
关于如何利用文献的若干建议
关于学术研究和论文发表的一些建议
关于科研中如何学习基础知识的一些建议 (一 ...
一个自编的经济学建模小案例 --写给授课本科 ...
AI智能体赋能教学改革: 全国AI教育教学应用 ...
2025中国AIoT产业全景图谱报告-406页
关于文献求助的一些建议
说点什么
分享
微信
QQ空间
QQ
微博
扫码加好友,拉您进群
各岗位、行业、专业交流群